remove express from engines

This commit is contained in:
SrGooglo 2024-09-25 18:40:23 +00:00
parent a462d5bb9b
commit b1564643ae

View File

@ -1,37 +0,0 @@
import { createServer } from "node:http"
import express from "express"
import socketio from "socket.io"
import rtengine from "../../classes/rtengine"
export default class Engine {
constructor(params) {
this.params = params
}
http = null
app = null
io = null
ws = null
router = express.Router()
init = async (params) => {
console.warn("⚠️ Warning: Express engine is deprecated, use HyperExpress instead!")
this.app = express()
this.http = createServer(this.app)
this.io = new socketio.Server(this.http)
this.ws = new rtengine({
...params,
io: this.io,
http: false,
})
this.app.use(express.json())
this.app.use(express.urlencoded({ extended: true }))
}
listen = async () => {
await this.http.listen(this.params.listen_port)
}
}