-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.js
More file actions
24 lines (20 loc) · 724 Bytes
/
index.js
File metadata and controls
24 lines (20 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
* @description Real-time chat application using NodeJS, VueJS & Socket.io. This is the main file that we run with NodeJS.
* @author Aaron Welsh
*
*/
const express = require('express');
const app = express();
const http = require('http').Server(app);
const io = require('socket.io')(http);
const port = process.env.port | 8080;
const routes = require('./src/server/routes');
const api = require('./src/server/api');
app.use("/dist", express.static('dist')); // Server static files
require('./src/server/sockets.js')(io);
app.use('/', routes);
app.use('/api', api);
// Start server
http.listen(port, () => {
console.log(`🚀 App online at http://localhost:${port} 💬`);
});