mirror of
https://github.com/darkwire/darkwire.io.git
synced 2025-07-19 11:02:58 +00:00
Configurable port
This commit is contained in:
parent
6ec8d9c5a0
commit
4338f1aa8a
11
src/app.js
11
src/app.js
@ -1,14 +1,17 @@
|
|||||||
|
import _ from 'underscore';
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import mustacheExpress from 'mustache-express';
|
import mustacheExpress from 'mustache-express';
|
||||||
import Io from 'socket.io';
|
import Io from 'socket.io';
|
||||||
import http from 'http';
|
import http from 'http';
|
||||||
import shortid from 'shortid';
|
import shortid from 'shortid';
|
||||||
import _ from 'underscore';
|
|
||||||
import Room from './room';
|
|
||||||
import favicon from 'serve-favicon';
|
import favicon from 'serve-favicon';
|
||||||
import compression from 'compression';
|
import compression from 'compression';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
|
import Room from './room';
|
||||||
|
|
||||||
|
const $PORT = 3000;
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const server = http.createServer(app);
|
const server = http.createServer(app);
|
||||||
const io = Io(server);
|
const io = Io(server);
|
||||||
@ -51,6 +54,6 @@ app.get('/:roomId', (req, res) => {
|
|||||||
return res.redirect('/');
|
return res.redirect('/');
|
||||||
});
|
});
|
||||||
|
|
||||||
server.listen(3000, () => {
|
server.listen($PORT, () => {
|
||||||
console.log('darkwire is online.');
|
console.log(`darkwire is online on port ${$PORT}.`);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user