From 964886ae8f530a6c532d106f589fb3f2e6a357a0 Mon Sep 17 00:00:00 2001 From: Raphael Cerveaux Date: Wed, 14 Nov 2018 15:43:28 +0100 Subject: [PATCH] Update README.md --- README.md | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4a0af78..e785095 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,49 @@ RESTful API based on Expressjs. Build status -## Overview +WARNING: This is for demo purposes. You should not run this in production (no cors, unit tests ...). -### Features +## Features -- Sign up -- Sign in -- CRUD notes -- reset password (optional) +- Sign up/sign in (JWT, bcrypt) +- Create, update, delete, read your notes +- Manage your account: update, delete -### Models +## Call the API -- User: firstname, lastname, email, password -- Note: title, text, author -- Auth: jwt_token, expiration_date +As best practice, use these headers to make requests to the API: + +``` +Content-Type:application/x-www-form-urlencoded +Accept:application/json +``` + +## API response + +The response code will never be in the response. + +**Make operations** (create, update, delete ...) + +```js +{ + success: false, + message: 'Oups!' +} +``` + +**Getting objects** (read) + +```js +{ + "_id": "5bec2fed257ab94172cd3874", + "firstname": "Raphael", + "lastname": "NA", + "username": "sundown", + "createdAt": "2018-11-14T14:23:41.581Z", + "updatedAt": "2018-11-14T14:23:41.581Z", + "__v": 0 +} +``` ## Specs