You will need install Node.js
, npm
and MongoDB
in your environement.
-
Just go on official Node.js website and download the installer. Also, be sure to have
git
available in your PATH,npm
might need it (You can find git here). -
You can install nodejs and npm easily with apt install, just run the following commands.
$ sudo apt install nodejs $ sudo apt install npm
-
You can find more information about the installation on the official Node.js website and the official NPM website.
If the installation was successful, you should be able to run the following command.
$ node --version
v13.12.0
$ npm --version
6.14.2
If you need to update npm
, you can make it using npm
! Cool right? After running the following command, just open again the command line and be happy.
$ npm install npm -g
Install MongoDb Guide
$ git clone https://github.com/MASISKAR/todo-list-api
$ cd todo-list-api
$ npm install
Remove .sample
extension from configuration files located in /config/env/
sh dev.env.sample -> dev.env prod.env.sample -> prod.env
$ npm start
request url API_HOST/task
request method POST
request body
{
title: {String}
, (required)
description: {String}
,
date: {String}
}
request url API_HOST/task
request method GET
{
status: OneOf['active', 'done']
,
search: {searchString}
,
create_lte: {dateString}
,
create_gte: {dateString}
,
complete_lte: {dateString}
,
complete_gte: {dateString}
,
sort: OneOf['a-z', 'z-a', 'creation_date_oldest', 'creation_date_newest', 'completion_date_oldest', 'completion_date_newest']
,
}
request url API_HOST/task/:taskId
request method GET
request url API_HOST/task/:taskId
request method PUT
request body
{
title: {String}
,
description: {String}
,
date: {String}
}
request url API_HOST/task/:taskId
request method PUT
request body
{
status: OneOf['active', 'done']
,
}
request url API_HOST/task/:taskId
request method DELETE
request url API_HOST/task
request method PATCH
request body
{
tasks: {Array[String{task id}]}
,
}
request url API_HOST/user
request method POST
request body
{
email: {String}
(required)
password: {String}
(required)
name: {String}
(required)
surname: {String}
(required)
}
request url API_HOST/user/sign-in
request method POST
request body
{
email: {String}
(required)
password: {String}
(required)
}
request url API_HOST/user/sign-out
request method POST
request body
{
jwt: {JWT string}
(required)
}
request url API_HOST/user/:id/token
request method PUT
request body
{
refreshToken: {string}
(required)
}
request url API_HOST/user
request method GET
request url API_HOST/user
request method PUT
request body
{
name: {String}
surname: {String}
}
request url API_HOST/form
request method POST
request body
{
name: {String}
, (required)
email: {String}
, (required)
message: {String}
}