This is the project files for CodeWorkr's API Authentication with Node series on YouTube.
- Introduction
- Cookies vs Tokens
- Node/Express API Setup
- Server-Side Validation
- MongoDB/Mongoose
- JSON Web Tokens
- Passport and Strategies
- Bcrypt Explained
- OAuth Explained
- Unit Testing
- Google OAuth
- Facebook OAuth
Series link: YouTube Playlist
$ git clone https://github.com/eXtremeXR/APIAuthenticationWithNode.gitthen checkout the branch as follow
$ git checkout 'branch_name'This project uses async/await it would be best if you use node 8+ after checkout be sure to run
$ npm installinstalling using yarn
$ yarn installTo run the project use
$ npm run start-devstarting the project using yarn
$ yarn start-devrun unit tests
$ yarn testgenarate code coverage report
$ yarn reportrun unit tests with nyc output in terminal
$ yarn nycrun unit tests with nyc summery report
$ yarn text-report| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Lines |
|---|---|---|---|---|---|
| All files | 90.53 | 62.5 | 100 | 90.43 | |
| server | 81.08 | 50 | 100 | 81.08 | |
| app.js | 85.71 | 50 | 100 | 85.71 | 10,17 |
| passport.js | 78.26 | 50 | 100 | 78.26 | 19,25,39,47,53 |
| server/configuration | 100 | 100 | 100 | 100 | |
| index.js | 100 | 100 | 100 | 100 | |
| server/controllers | 100 | 100 | 100 | 100 | |
| users.js | 100 | 100 | 100 | 100 | |
| server/helpers | 100 | 75 | 100 | 100 | |
| routeHelpers.js | 100 | 75 | 100 | 100 | 11 |
| server/models | 88.24 | 100 | 100 | 88.24 | |
| user.js | 88.24 | 100 | 100 | 88.24 | 29,37 |
| server/routes | 100 | 100 | 100 | 100 | |
| users.js | 100 | 100 | 100 | 100 |