@maiar-ai/core / ServerManager
Class: ServerManager
Defined in: packages/core/src/runtime/managers/server.ts:17
Constructors​
new ServerManager()​
new ServerManager(
__namedParameters):ServerManager
Defined in: packages/core/src/runtime/managers/server.ts:25
Parameters​
__namedParameters​
Returns​
Accessors​
server​
Get Signature​
get server():
Server
Defined in: packages/core/src/runtime/managers/server.ts:32
Returns​
Server
Methods​
registerRoute()​
registerRoute(
method,path,handler,middleware?):void
Defined in: packages/core/src/runtime/managers/server.ts:44
Register a route handler for the router
Parameters​
method​
The HTTP method of the route
"get" | "post"
path​
string
The path of the route
handler​
(req, res) => void | Promise<void>
The handler function for the route
middleware?​
The middleware functions for the route
RequestHandler | RequestHandler[]
Returns​
void
start()​
start():
Promise<void>
Defined in: packages/core/src/runtime/managers/server.ts:111
Returns​
Promise<void>
stop()​
stop():
Promise<void>
Defined in: packages/core/src/runtime/managers/server.ts:133
Returns​
Promise<void>