-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathserver.js
executable file
·34 lines (27 loc) · 1.05 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use strict'
require('dotenv').config({ silent: true });
const express = require('express');
const logger = require('morgan');
const path = require('path');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const app = express();
const PORT = process.argv[2] || process.env.PORT || 3000;
const roverRouter = require('./routes/rover');
const visionRouter = require('./routes/vision');
const bingRouter = require('./routes/bing');
const usersRouter = require('./routes/api/users');
const authRouter = require('./routes/api/auth');
const imagesRouter = require('./routes/images');
console.log(visionRouter);
app.use(logger('dev'));
app.use(express.static(path.join(__dirname, 'dist')));
app.use(cookieParser());
app.use(bodyParser.json());
app.use('/rover', roverRouter);
app.use('/vision', visionRouter);
app.use('/bing', bingRouter);
app.use('/api/users', usersRouter);
app.use('/api/auth', authRouter);
app.use('/images', imagesRouter)
app.listen(PORT, () => console.log('server here! listening on', PORT));