This project uses async/await it would be best if you use node 8+ after checkout be sure to run
// Admin User
dady@gmail.com/123
// Non admin user
kid@gmail.com/123
// public (GET)
https://hkauthapi.herokuapp.com/users
// signup (POST)
https://hkauthapi.herokuapp.com/users/signup
// Signin (POST)
https://hkauthapi.herokuapp.com/users/signin
// Google Auth (POST)
https://hkauthapi.herokuapp.com/users/oauth/google
// Facebook Auth (POST)
https://hkauthapi.herokuapp.com/users/oauth/facebook
// Access Protected Resource (GET)
https://hkauthapi.herokuapp.com/users/secret
// public (GET)
https://localhost:3000/users
// signup (POST)
https://localhost:3000/users/signup
// Signin (POST)
https://localhost:3000/users/signin
// Google Auth (POST)
https://localhost:3000/users/oauth/google
// Facebook Auth (POST)
https://localhost:3000/users/oauth/facebook
// Access Protected Resource (GET)
https://localhost:3000/users/secret
$ npm install
installing using yarn
$ yarn install
To run the project use
$ npm run server-dev
starting the project using yarn
$ yarn start
run unit tests
$ yarn test
genarate code coverage report
$ yarn report
run unit tests with nyc output in terminal
$ yarn nyc
run unit tests with nyc summery report
$ yarn text-report
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Lines |
---|---|---|---|---|---|
All files | 100 | 100 | 100 | 100 | |
controllers | 100 | 100 | 100 | 100 | |
users.js | 100 | 100 | 100 | 100 | |
routes | 100 | 100 | 100 | 100 | |
users.js | 100 | 100 | 100 | 100 |
Step1 https://developers.google.com/oauthplayground
Step1 https://developers.facebook.com/tools/accesstoken/
=========================================================
get access_token
Get API key & Secret https://console.developers.google.com/apis/credentials?project=nodeapiauth
** Create FB App** https://developers.facebook.com
** Access token** https://developers.facebook.com/tools/accesstoken/
// pagination
http://localhost:3000/books/:skip/:top
http://localhost:3000/books/1/2
npm run server-dev
http://localhost:3000/courses