Skip to content

marioterron/todo-list-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS MongoDB ExpressJS PugJS ES6 npm

HTML5, CSS3 and JS jQuery Bootstrap Bower

Standard - JavaScript Style Guide

SKYTASKR! is a simple to-do list app build with HTML, CSS, jQuery, Express.js, MongoDB and Mongoose at Skylab Coders Academy Full Stack Web Development Bootcamp.

Installation

To first need to set some environment variables for this app

DB_URI=localhost:27017/<%YOUR_DB_NAME%>
PORT=<%YOUR_PORT%>

These environment variables can be set in an .env file located in the root of the folder

Or you can directly pass them when calling the app

DB_URI=localhost:27017/<%YOUR_DB_NAME%> PORT=3000 npm run dev

Note: You also need to have a mongo daemon running

Launching the app

You can launch the app using some NPM scripts:

  • npm start Will launch the app and will install the dependencies (npm & bower) automatically
  • npm run dev Will launch the app w/ nodemon so it will restart itself when any file of the project is modified and saved
  • npm run dev:debug Will launch the npm run dev script w/ lots of debugging info about the app

API Endpoints

All these endpoints will start locally w/ http://localhost:3000

Example: http://localhost:3000/tasks

GET endpoints

[GET] tasks

Get list all tasks

curl localhost:3000/tasks

[GET] tasks/completed

Get list all completed tasks

curl localhost:3000/tasks/completed

[GET] tasks

Get list all pending tasks

curl localhost:3000/tasks/pending

POST endpoints

[POST] tasks

To add a task. It only need a title value. The rest of the values (completed, createdAt, id) will be added automatically

curl -X POST --data "title=Buy water" localhost:3000/tasks

PUT endpoints

[PUT] task/:id

To update a task. It needs to receive one or more of the following values: completed, title (even if not all are being updated).

curl -X PUT --data "completed=true" localhost:3000/task/59255d4b9104a81def8eef5a
curl -X PUT --data "title=Buy more water" localhost:3000/task/59255d4b9104a81def8eef5a

DELETE endpoints

[DELETE] task/:id

To remove a task. Only by passing an id the task will be removed.

curl -X DELETE localhost:3000/task/59255d4b9104a81def8eef5a

About

💾 A to-do list app build with Node.js, Express.js and MongoDB at Skylab Coders Academy Full Stack Web Development Bootcamp.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published