- Create public and private RSA keys (
public.key, private.key
). Generate them here. npm install --save-dev jsonwebtokens json-server faker
- create
users.json
with at least email and password for a fake user. - Add these to package.json (assumes code is in a directory called
api
):
"api-noAuth": "node_modules/.bin/json-server api/seed.js",
"api-auth": "node ./api/server.js",
"api-seed": "node ./api/seed.js > api/db.json"
npm run api-seed
will create db.json,npm run api-noAuth
is just the apinpm run api-auth
will create and require tokens.