Initial commit again

This commit is contained in:
2024-04-29 20:32:49 +02:00
parent 97dc6d222a
commit 9a60709d56
117 changed files with 101 additions and 13571 deletions

24
api/src/server.ts Normal file
View File

@ -0,0 +1,24 @@
import http from 'http'
import { app } from './app'
import env from './config/environment'
import { Succ } from './services/globalService'
import database from './config/database'
const port: number = env.APP_PORT || 8080
const hostname: string = env.APP_HOSTNAME || 'localhost'
export const server = http.createServer(app)
// Server
export function runServer(): void {
server.listen(port, hostname, () => {
new Succ(200, `Server is listening on http://${hostname}:${port}`)
})
}
if (!env.NORK.database) {
runServer()
} else {
const db_connection = database()
if (db_connection) {
runServer()
}
}