mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 10:34:17 +00:00
remove express from engines
This commit is contained in:
parent
a462d5bb9b
commit
b1564643ae
@ -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)
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user