mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 10:20:16 +01:00
implemented endpoints for uploading and showing team pictures
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { createServer } from "https";
|
||||
import express from "express";
|
||||
|
||||
import { Server } from "socket.io";
|
||||
import Game from "./game.js";
|
||||
import { config } from "dotenv";
|
||||
@@ -6,21 +8,25 @@ import { readFileSync } from "fs";
|
||||
import { initAdminSocketHandler, secureAdminBroadcast } from "./admin_socket.js";
|
||||
import { initTeamSocket, playersBroadcast } from "./team_socket.js";
|
||||
import { PenaltyController } from "./penalty_controller.js";
|
||||
import { initPhotoUpload } from "./photo.js";
|
||||
//extract admin password from .env file
|
||||
config();
|
||||
const HOST = process.env.HOST;
|
||||
const PORT = process.env.PORT;
|
||||
|
||||
export const app = express()
|
||||
|
||||
const httpsServer = createServer({
|
||||
key: readFileSync(process.env.SSL_KEY, 'utf-8'),
|
||||
cert: readFileSync(process.env.SSL_CERT, 'utf-8')
|
||||
});
|
||||
}, app);
|
||||
|
||||
httpsServer.listen(PORT, HOST, () => {
|
||||
console.log(`Server running`);
|
||||
});
|
||||
|
||||
|
||||
|
||||
//set cors to allow all origins
|
||||
export const io = new Server(httpsServer, {
|
||||
cors: {
|
||||
@@ -47,4 +53,5 @@ penaltyController.init()
|
||||
|
||||
|
||||
initAdminSocketHandler();
|
||||
initTeamSocket();
|
||||
initTeamSocket();
|
||||
initPhotoUpload();
|
||||
Reference in New Issue
Block a user