mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-28 01:30:17 +01:00
Restructuration of the project folders
This commit is contained in:
30
server/traque-back/index.js
Normal file
30
server/traque-back/index.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import { createServer } from "http";
|
||||
import express from "express";
|
||||
import { Server } from "socket.io";
|
||||
import { config } from "dotenv";
|
||||
import { initAdminSocketHandler } from "./admin_socket.js";
|
||||
import { initTeamSocket } from "./team_socket.js";
|
||||
import { initPhotoUpload } from "./photo.js";
|
||||
|
||||
config();
|
||||
const HOST = process.env.HOST;
|
||||
const PORT = process.env.PORT;
|
||||
|
||||
export const app = express();
|
||||
|
||||
const httpServer = createServer({}, app);
|
||||
|
||||
httpServer.listen(PORT, HOST, () => {
|
||||
console.log("Server running on http://" + HOST + ":" + PORT);
|
||||
});
|
||||
|
||||
export const io = new Server(httpServer, {
|
||||
cors: {
|
||||
origin: "*",
|
||||
methods: ["GET", "POST"]
|
||||
}
|
||||
});
|
||||
|
||||
initAdminSocketHandler();
|
||||
initTeamSocket();
|
||||
initPhotoUpload();
|
||||
Reference in New Issue
Block a user