chore: rename src/ to server/

This commit is contained in:
CrescentLeaf
2025-08-30 14:43:45 +08:00
parent 5e756636a9
commit 5666bcba24
16 changed files with 2 additions and 2 deletions

23
server/main.ts Normal file
View File

@@ -0,0 +1,23 @@
import ApiManager from "./api/ApiManager.ts"
import express from 'express'
import SocketIo from 'socket.io'
import HttpServerLike from "./types/HttpServerLike.ts"
import config from './config.ts'
import http from 'node:http'
import https from 'node:https'
const app = express()
const httpServer: HttpServerLike = (
((config.server.use == 'http') && http.createServer(app)) ||
((config.server.use == 'https') && https.createServer(config.server.https, app)) ||
http.createServer(app)
)
const io = new SocketIo.Server(httpServer, {
})
ApiManager.initServer(httpServer, io)
ApiManager.initEvents()
ApiManager.initAllApis()
httpServer.listen(config.server.listen)