Fake REST API server of tasks from Among Us
This application is backed by the default data from a json file (default to be db.json
, however it can be specified through an environment variable).
The underlying server that power the application is json-server
Simply npm start
and the server will be started with the default configurations on port 3000 and db file to be db.json
DB
: path to the json file that will be used as the databasePORT
: port that the app will start on
- Code linting:
npm run lint
- Full test suite:
npm test
Data from the json database file will be loaded every time the app starts and db writes will be made to the same file as well. Hence, a note on if the data is not commited into source, we might see differences between environments.
Listed below are basic usages of the API, more advanced usages can be found here.
Create a new tasks
POST /todos
{
text: string,
type: "short" | "long" | "common"
}
Get task by ID
GET /todos/:id
Get tasks
GET /todos
Possible query parameters:
q
: full text search_page
and_limit
: paginate- any fields from the TODO object: filter using specific fields
_start
and_end
: slice based on TODO ID
Replace whole TODO item content
PUT /todos/:id
{
text: string,
type: "common" | "long" | "short"
}
Partial update TODO item
PATCH /todos/:id
{
text?: string,
type?: "common" | "long" | "short"
}
Delete a TODO item
DELETE /todos/:id
For any requests, bug or comments, please open an issue or submit a pull request.