Skip to content
This repo contains the back-end for paper-notes.netlify.com, a full stack notes application. It has a PostgreSQL database, password hashing via bcryptjs, and is deployed to Heroku.
JavaScript
Branch: master
Clone or download
Pull request Compare This branch is 53 commits ahead, 3 commits behind LambdaSchool:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api
data
notes
users
.gitignore
Procfile
README.md
index.js
knexfile.js
middleware.js
package-lock.json
package.json

README.md

API can be found at https://nameless-cliffs-24621.herokuapp.com/

How to use this API

GET /: sanity check, ensures the API is online. Returns { "api": "running" }.

GET api/users: returns all usernames and encrypted passwords, other than the seeded users which are set to "pass"

POST api/register: must have both a username and password. Creates a new user and returns a welcome message.

POST api/login: must have both a username and password. Returns a welcome message, JSON Web Token, and all of the user's notes.

All other routes are protected, the request must be sent with an Authentication header with valid JSON Web Token in order to get the expected data.

GET api/notes: returns all of the logged in user's notes.

GET api/notes/id: returns the note at the ID if the requested note belongs to the logged in user.

POST api/notes: must have both a title and content in order to be accepted. Returns the ID of the newly created note.

PUT api/notes/id: must have both a title and content in order to be accepted. Returns the number of notes edited.

DELETE api/notes/id: deletes the note at the ID. Returns the number of notes deleted.

You can’t perform that action at this time.