Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sinedied/azure-functions-todo-api
Simple todo list API built with Azure Functions and Node.js
https://github.com/sinedied/azure-functions-todo-api
api azure azure-functions bicep infrastructure-as-code javascript nodejs serverless todo
Last synced: 3 months ago
JSON representation
Simple todo list API built with Azure Functions and Node.js
- Host: GitHub
- URL: https://github.com/sinedied/azure-functions-todo-api
- Owner: sinedied
- License: mit
- Created: 2022-07-18T13:07:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-22T12:53:37.000Z (over 2 years ago)
- Last Synced: 2024-10-09T08:42:47.868Z (4 months ago)
- Topics: api, azure, azure-functions, bicep, infrastructure-as-code, javascript, nodejs, serverless, todo
- Language: Shell
- Homepage: https://func-todo-api-prod-pavmt75fjq3kk.azurewebsites.net/api/
- Size: 129 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ✅ Todo API for Azure Functions
[![Deploy on Azure](https://github.com/sinedied/azure-functions-todo-api/actions/workflows/deploy.yml/badge.svg)](https://github.com/sinedied/azure-functions-todo-api/actions/workflows/deploy.yml)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)> Simple todo list API built with Azure Functions and Node.js.
All entries are stored in-memory and are not persisted, so when the server is stopped all data is lost.
## API details
Route | Description
---------------------------------------------|------------------------------------
`GET /api/` | Get server info
`GET /api/users/:userId/tasks` | Get tasks for specified user, creating a new account if needed.
`POST /api/users/:userId/tasks` | Add a new task for specified user, creating a new account if needed. Payload: `{ "description": "" }`
`PATCH /api/users/:userId/tasks/:taskId` | Update specified task. Payload: `{ "completed": }`
`DELETE /api/users/:userId/tasks/:taskId` | Delete specified task## Running the server locally
Make sure you have [Node.js](https://nodejs.org) and [Azure Functions Core Tools](https://aka.ms/functions-core-tools) installed.
1. Run `cd api && npm install`.
2. Run `npm start`. The API will be available at `http://localhost:7071/api/`.## Deploying on Azure
You need an [Azure account](https://azure.microsoft.com/free/?WT.mc_id=javascript-0000-yolasors), [Azure CLI](https://aka.ms/tools/azure-cli) and [GitHub CLI](https://cli.github.com) installed.
If you're using Windows, you'll also either need to use [WSL](https://docs.microsoft.com/windows/wsl/install?WT.mc_id=javascript-0000-yolasors) or [Git Bash](https://git-scm.com/downloads) to run the scripts.1. Run `.azure/setup.sh`, and follow the instructions. At the end of the process, the first deployment will be triggered.
Now every time you make a commit to the repository, the project will be automatically redeployed to Azure using [GitHub Actions](https://github.com/features/actions).
If you want to clean up everything and delete the deployed resources, run `.azure/setup.sh --terminate`.