1.0.6 • Published 2 years ago
kiro-passport v1.0.6
This is a beta version !
This module is based on passport authentication system
It generate all passport configuration for use with express
It can be used in complement with the module kiro-rvcgen
Step 1 - run
npm i kiro-passport
Step 2 - require the module in your generator.js
const passportAuthGenerator = require("kiro-passport") ;
passportAuthGenerator()
Step 3 - run the generator
node generator
Step 4 - This will create
- auth folder in you app with required files
- auth.js controller file in ./controllers/Auth.js
- auth.js route in ./routes/auth.js
- routes-inc.js in ./routes/routes-inc.js
Step 5 - in your express app (or server) add the followin after "const app = express();"
...
const app = express(); //remove this if already decalred
const startPassport = require("./auth/startPassport");
startPassport(app)
...
Step 6 - dont forget to include route in your app
// Routes
const Routes = require("./routes/routes-inc.js");
app.use("/", Routes);
That's it !