loading port from config file

This commit is contained in:
2022-01-30 12:00:23 +02:00
parent c9805693e8
commit 0c507fd33b
4 changed files with 10 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ import { Socket } from "socket.io";
import { Player } from "./player";
import { PlayerList } from "./playerList";
import { MapTile } from "./mapTile";
import * as config from './config.json';
const app: express.Application = express();
@@ -278,6 +279,6 @@ io.on("connect", (socket: Socket) => {
// });
// });
server.listen(3000, () => {
console.log("listening on *:3000");
server.listen(config.port || 3000, () => {
console.log("listening on *:" + (config.port || 3000));
});

3
src/config.json Normal file
View File

@@ -0,0 +1,3 @@
{
"port": 3000
}