In this section, you will create a function to implement the API responses of a blog article.
- Log in to the SCF Console and select Function Service on the left sidebar.
- Select the Beijing region at the top of the "Function Service" page and click Create to enter the function creation page.
Set the following parameter information and click Next as shown below:
- Function Name: enter "blogArticle".
- Runtime Environment: select "Python 3.6".
- Creation Method: select Template function.
- Fuzzy Search: enter "api_service" for search.
Click View Details in the template to view related information in the pop-up "Template Details" window where you can also perform downloads.
The data structure for storing the article is saved and simulated by the
testArticleInfo variable, which is usually read from the database or file in real applications.
- Keep the default configuration and click Complete to complete the function creation.