mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
34 lines
774 B
JavaScript
Executable File
34 lines
774 B
JavaScript
Executable File
import { Server } from "linebridge/src/server"
|
|
|
|
import DbManager from "@shared-classes/DbManager"
|
|
|
|
import StartupDB from "./startup_db"
|
|
|
|
import SharedMiddlewares from "@shared-middlewares"
|
|
|
|
export default class API extends Server {
|
|
static refName = "main"
|
|
static useEngine = "hyper-express"
|
|
static routesPath = `${__dirname}/routes`
|
|
static listen_port = process.env.HTTP_LISTEN_PORT || 3000
|
|
|
|
middlewares = {
|
|
...require("@middlewares").default,
|
|
...SharedMiddlewares
|
|
}
|
|
|
|
events = require("./events")
|
|
|
|
contexts = {
|
|
db: new DbManager(),
|
|
}
|
|
|
|
async onInitialize() {
|
|
await this.contexts.db.initialize()
|
|
await StartupDB()
|
|
}
|
|
|
|
handleWsAuth = require("@shared-lib/handleWsAuth").default
|
|
}
|
|
|
|
Boot(API) |