mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 10:34:17 +00:00
added basicServer
This commit is contained in:
parent
78ceb643c4
commit
5ecd15e59f
23
utests/basicServer.js
Normal file
23
utests/basicServer.js
Normal file
@ -0,0 +1,23 @@
|
||||
import { Server, Controller } from "../src/server"
|
||||
|
||||
const TestControllers = [
|
||||
class AController extends Controller {
|
||||
get = {
|
||||
"/test": (req, res) => {
|
||||
return res.send("Hello World!")
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
async function _main() {
|
||||
const server = new Server({
|
||||
httpEngine: "express"
|
||||
}, TestControllers)
|
||||
|
||||
await server.initialize()
|
||||
}
|
||||
|
||||
_main().catch((error) => {
|
||||
console.error(`[MAIN_ERROR] ${error}`)
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user