Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require('express');
- const path = require('path');
- const routes = require('./routes');
- const middleware = require('./middleware');
- require('dotenv').config();
- const IP = process.env.IP || 'localhost';
- const PORT = process.env.PORT || '3000';
- const app = express();
- app.use(middleware.bodyParser.json());
- app.use(middleware.bodyParser.urlencoded({extended: false}));
- app.use(middleware.cookieParser());
- app.set('views', path.join(__dirname, 'views'));
- app.set('view engine', 'ejs');
- app.use(middleware.auth.session);
- app.use(middleware.passport.initialize());
- app.use(middleware.passport.session());
- app.use(express.static(path.join(__dirname, '../public')));
- app.use('/', routes.auth);
- app.use('/oxford', routes.oxford);
- app.use('/webster', routes.webster);
- app.use('/flashcards', routes.flashcards);
- app.listen(PORT, () => {
- console.log('listening on port ', PORT);
- });
Add Comment
Please, Sign In to add comment