Following are the prerequisites for this exercise:
- node
- mongodb
Below is an example of how you can install and set up your app.
- Install dependencies
npm install
-
Create a new file
.env
if it doesn't exist and copy the contents ofenv.dev
into it to be able to run your server on production environment. -
Then update the values of the configuration env files at the
.env
file.
- Start up the server - Run
# development
npm run dev
# production
npm start
- Server should be running on http://localhost:5000 by default
BASE URL: api/v1
Tasks: /tasks
- / GET - Get all tasks (Filters => name, status & sorts => dueAt, startAt, doneAt)
- /:id GET - Get a task by ID
- / POST - Create a new task
- /:id PUT - Update an existing task
- / - Delete an existing task
- /status/:id PUT - Update the status of a task
Projects: /projects
- / GET - Get all projects (Filters => name & sorts => dueAt, startAt)
- /:id GET - Get a project by ID
- / POST - Create a new project
- /:id PUT - Update an existing project
- / - Delete an existing project
- /task POST - Assing / Unassign a task to a project
Aggregations: /aggregations
- /tasks GET - All the tasks that have a project with a due date set to “today”
- /projects GET - All the projects that have a task with a due date set to “today”