mirror of
https://github.com/demostf/sync.git
synced 2026-06-03 18:44:06 +02:00
get port from env
This commit is contained in:
parent
40dc4749cf
commit
16ad3436a9
1 changed files with 4 additions and 3 deletions
7
sync.ts
7
sync.ts
|
|
@ -9,7 +9,7 @@ interface Session {
|
||||||
playing: boolean;
|
playing: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sessions: {[name: string]: Session} = {};
|
const sessions: { [name: string]: Session } = {};
|
||||||
|
|
||||||
interface JoinPacket {
|
interface JoinPacket {
|
||||||
type: 'join';
|
type: 'join';
|
||||||
|
|
@ -40,8 +40,9 @@ const server = createServer(function (request, response) {
|
||||||
response.writeHead(404);
|
response.writeHead(404);
|
||||||
response.end();
|
response.end();
|
||||||
});
|
});
|
||||||
server.listen(8181, function () {
|
const port = process.env.PORT || 80;
|
||||||
console.log((new Date()) + ' Server is listening on port 8080');
|
server.listen(port, function () {
|
||||||
|
console.log(`${(new Date())} Server is listening on port ${port}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
const wsServer = new WebSocketServer({
|
const wsServer = new WebSocketServer({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue