A very simple API for using a cloud based to-do list
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Trevor Richards 495eb01193 debug heroku 3 years ago
data converted from obj storage to sqlite 3 years ago
models debug heroku 3 years ago
modules enable login error logging to debug heroku 3 years ago
.gitignore converted from obj storage to sqlite 3 years ago
app.js converted from obj storage to sqlite 3 years ago
package-lock.json add auth token generator 3 years ago
package.json add auth token generator 3 years ago
readme.md update readme 3 years ago

readme.md

A "todo" list API

A very simple API for using a cloud based to-do list

Live on Heroku

Check it out here

API Endpoints

All methods concerning todo lists require an Auth header token that's created and returned to you by logging in

GET:

  • /todos - Get all incompleted items on the todo list
  • /todos/id - Get specific todo item by id (Eg. todos/2)
  • /todos/completed - Get all completed todos

Search parameters

  • /todos?completed=true Same as /todos/completed
  • /todos?q=search Filter by search query. Example: /todos?q=dog&completed=true - will return all dog related todos that are completed

POST: Done in JSON format

  • /todos - Add a todo item. {"description": "A todo item", "completed": false}
  • /users - Add a new user. {"email": email@example.com, "password": "12345"}
  • /users/login - Login an existing user. {"email": email@example.com, "password": "12345"} sends back a login token in the Auth header to be used for all future requests

DELETE:

  • /todos/id - Delete a todo list item. Eg /todos/2 - will delete todo item with the id of 2
  • /users/login - Logout an existing user. Requires Login Auth Header generated by logging in.

PUT:

  • /todos/id - Update a todo list item. Format is JSON, eg: {"description": "A todo item", "completed": true}

TODO (lol)

  • Convert static object of todo items into a database.
  • Add the ability to add/remove/modify todo items
  • Add user authentication
  • Use tokens to access specific user todos

A note on Databases

This app is setup to use postgres on the live server (heroku). If you clone or download this git and run NPM install, it should work locally using sqlite.