-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
25 lines (22 loc) · 816 Bytes
/
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
const express = require('express');
const config = require('./config.json');
const path = require('path');
const index = require('./routes/index');
const connect = require('./routes/connect');
const oauth = require('./routes/oauth');
const user = require('./routes/user');
const bodyParser = require('body-parser');
// Express connection and set views
const app = express();
app.set('views', path.join(__dirname, 'views', 'html'));
app.set('view engine', 'ejs');
app.use(bodyParser.json());
app.listen(config.hostnamePort, config.hostname, () => {
console.log('Starting the serveur called %s on port %s', config.hostname, config.hostnamePort);
});
app.use(express.static('public'));
app.use('/index', index);
app.use('/connect', connect);
app.use('/oauth', oauth);
app.use('/user', user);
module.exports = app;