import express from 'express'
import mongoose from 'mongoose'

import morgan from 'morgan';

import session from 'express-session';
import connectRedis from 'connect-redis';

// Routes
// import fooRoutes from './routes/foo';

// mongoose.connect('mongodb://localhost/dfotose');
//
//
const app = express();

const RedisStore = connectRedis(session);
const sessionMiddleware = session({
  store: new RedisStore({
    host: '127.0.0.1',
    port: 6379
  }),
  secret: 'XVUtmVft5KwvC7QmsmYF2SJn3z5c8e3B',
  resave: false,
  saveUninitialized: false,
  name: 'dfotose.session',
});

app.use('/', express.static(__dirname + '/public'));

app.use(morgan('dev'));
app.use(sessionMiddleware);

// app.use(fooRoutes);

app.listen(4000, () => {
  console.log('Listening :4000');
});

@@ -182,27 +182,71 @@
 tes%0A
-// 
 import 
-foo
+imageRouter from './routes/image-api';%0Aimport auth
 Route
-s
+r
  fro
@@ -261,18 +261,20 @@
 tes/
-foo
+auth-api
 ';%0A%0A
-// 
 mong
@@ -322,13 +322,8 @@
 ');%0A
-//%0A//
 %0Acon
@@ -728,25 +728,179 @@
 %0A// 
-app.use(foo
+Include all routes%0Aconst baseUrl = '/v1';%0A%0A// Auth routes should not be prepended%0Aapp.use(authRouter);%0A%0A// Pure API routes should be prepended%0Aapp.use(baseUrl, image
 Route
-s
+r
 );%0A%0A

add new routes to server