mirror of
https://github.com/demostf/sync.git
synced 2026-06-03 10:34: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;
|
||||
}
|
||||
|
||||
const sessions: {[name: string]: Session} = {};
|
||||
const sessions: { [name: string]: Session } = {};
|
||||
|
||||
interface JoinPacket {
|
||||
type: 'join';
|
||||
|
|
@ -40,8 +40,9 @@ const server = createServer(function (request, response) {
|
|||
response.writeHead(404);
|
||||
response.end();
|
||||
});
|
||||
server.listen(8181, function () {
|
||||
console.log((new Date()) + ' Server is listening on port 8080');
|
||||
const port = process.env.PORT || 80;
|
||||
server.listen(port, function () {
|
||||
console.log(`${(new Date())} Server is listening on port ${port}`);
|
||||
});
|
||||
|
||||
const wsServer = new WebSocketServer({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue