A template for a new project based on Express4, using Passport with a Local Strategy. The project also uses debug, models, and separate routers.
To use this template, follow these steps:
$ git clone https://github.com/TravelingTechGuy/express4-passport-template.git
$ cd ./express4-passport-template
$ npm install
$ node app
If you have nodemon installed, just type nodemon
.
- Commented app.js
- Passport with a Local Strategy - with model placeholders for Twitter, Facebook, or Google strategies
- Express modules used:
- Body Parser
- Cookie Parser
- Logger
- Favicon
- Compression
- Method Override
- passport and passport-local
- bcrypt-json
- Separation or models, views, and routes
- Separation of routers
- Errors router
- Errors returned in JSON format if the request header contains
Accept: application/json
- Separate debug calls in every module - run
npm start
to get all debug messages
The template is based on my initial Express4 template and the article by Chris Sevilleja on Scotch.io.