#TodoDoBackend
##Backend for AngularJSTodoApp & IonicTodoApp
This reposistory contains the source code that makes up the Backend for AngularJSTodoApp and IonicTodoApp.
Installation instructions on this backend are found below and also on the on the projects' repo linked above.
##Build, Testing, & Development
-
Need to have Nodejs and NPM, installed on your system globally. If running a Debian/Ubuntu system and you do not have the packages installed globally, run these commands below:
sudo apt update sudo apt install nodejs sudo ln -s /usr/bin/nodejs /usr/bin/node sudo apt install npm sudo npm install -g npm sudo npm install forever -g
-
Clone this repo.
-
In the root of the project folder, run
npm install
. -
Next, install mongodb on your system globally and have it running. If on a Ubuntu/Debian system, you would run
sudo apt install mongodb
. -
Use forever to start the server, run
forever start bin/www
. -
If you need to kill
forever
for any reasons, runforever list
. You will then see a list of allforever
processes. Kill theforever
process you want by identifying thepid
and killing it by runningforever stop pidNUM
where pidNUM is the pid number is the process you would like to kill. -
By default, the server will be listening on port 3000.
-
This backend allows the user to register, login, logout, create tasks, retrieve tasks, edit tasks, and delete tasks.
#Routes
using "POST" Method
/users/login
requires passing "email" and "password" fields in body
using"POST" Method
/users/register
requires passing "email" and "password" fields in body
using "GET" Method (Retrieves all Task for a user)
/tasks
requires passing in the user "token" as params
using "POST" Method (Creates a Task)
/tasks
requires passing in "title" and "body" fields in the body
using "PUT" Method (Updates a specific Task)
/tasks/:id
requires passing in "id" of a Task as an url paramater and token as query parameter
using "DELETE" Method (Deletes a specific Task)
/tasks/:id
requires passing in "id" of a Task as an url parameter and token as a query
parameter
Postman is a great API testing software for testing out this backend.
Pull request and issues are welcomed.