text: const createError = require('http-errors');
  const express = require('express');
  const app = express();
  const session = require('express-session');
  const path = require('path');
  const logger = require('morgan');
  const bodyParser = require('body-parser');
  // const passport = require('./lib/passport.js');
  
  var debug = require('debug')('ejs');
  app.use(logger('dev'));
  
  var db = require('./lib/db');
  
  var userRouter = require('./routes/user');
  
  app.set('views', path.join(__dirname + '/views'));
  app.set('view engine', 'ejs');
  app.engine('html', require('ejs').renderFile);
  
  app.use(express.json());
  app.use(bodyParser.urlencoded({
  	extended: false
  }));
  
  app.use('/public', express.static(path.join(__dirname, 'public')));
  
  app.use(session({
  	secret:'@#cat#@',
  	saveUninitialized:true,
  	resave:true
  }));
  
  // Passport
  // app.use(passport.initialize());
  // app.use(passport.session());
  
  app.use((req,res,next) => {
  	res.locals.user = req.session.user;
  	next();
  })
  
  
  
  app.use('/', userRouter);
  
  
  
  app.use( (req, res, next) => {
  	res.status(404).send('Can not find (404)');
  })
  
  module.exports = app;