-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
24 lines (19 loc) · 876 Bytes
/
index.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
require('dotenv').config({silent: true});
const express = require('express');
const logger = require('morgan');
const path = require('path');
const url = require('url');
const home = require('./routes/home');
const train = require('./routes/train');
const music = require('./routes/music');
const weather = require('./routes/weather');
const expressApp = express();
const port = process.env.PORT || 3000;
expressApp.use(express.static(path.join(__dirname, 'dist')));
expressApp.use(logger('dev'));
expressApp.listen(port, () => console.log('Server is listening on port: ', port));
expressApp.use('/', home);
expressApp.use('/train', train);
expressApp.use('/music', music);
expressApp.use('/weather', weather);
expressApp.use('*', express.static(path.join(__dirname, 'dist')));