Simple API with Azure Function for create, read and delete operations for blogs
npm install
Assuming you are using VS Code and all necessary extensions are installed, if not follow Azure Functions documentation here
- Rename
local.settings.sample.json
tolocal.settings.json
- Set "CosmosDbConnectionString" value in
local.settings.json
(MongoDB connection string will also work) - Start debugging (press F5)
API endpoint will be http://localhost:7071/api/blog
Test it using something like Postman/Insomnia
POST /api/blog
body
{
"title": "Title 1",
"content": "ABCD"
}
GET /api/blog/{blogId}
DELETE /api/blog/{blogId}