'use strict';

const express = require('express');

const app = express();
const PORT = process.env.PORT || 3000;

app.set('view engine', 'jade');

app.get('/', (req, res) => {
  res.render('index');
});

app.listen(PORT, () => {
  console.log(`App listening on port ${PORT}`);
});

@@ -18,186 +18,949 @@
 nst 
-express = require('express');%0A%0Aconst app = express();%0Aconst PORT = process.env.PORT %7C%7C 3000;%0A%0Aapp.set('view engine', 'jade');%0A%0Aapp.get('/', (req, res) =%3E %7B%0A  res.render('index');
+bodyParser = require('body-parser');%0Aconst express = require('express');%0Aconst session = require('express-session');%0Aconst RedisStore = require('connect-redis')(session);%0A%0Aconst app = express();%0Aconst PORT = process.env.PORT %7C%7C 3000;%0Aconst SESSION_SECRET = process.env.SESSION_SECRET %7C%7C 'secret';%0A%0Aapp.set('view engine', 'jade');%0A%0Aapp.use(bodyParser.urlencoded(%7B extended: false %7D));%0Aapp.use(session(%7B%0A  secret: SESSION_SECRET,%0A  store: new RedisStore()%0A%7D));%0A%0Aapp.get('/', (req, res) =%3E %7B%0A  res.render('index');%0A%7D);%0A%0Aapp.get('/login', (req, res) =%3E %7B%0A  res.render('login');%0A%7D);%0A%0Aapp.post('/login', (req, res) =%3E %7B%0A  res.redirect('/');%0A%7D);%0A%0Aapp.get('/register', (req, res) =%3E %7B%0A  res.render('register');%0A%7D);%0A%0Aapp.post('/register', (req, res) =%3E %7B%0A  if (req.body.password === req.body.verify) %7B%0A    res.redirect('/login');%0A  %7D else %7B%0A    res.render('register', %7B%0A      email: req.body.email,%0A      message: 'Passwords do not match'%0A    %7D);%0A  %7D
 %0A%7D);

add analytics