Interface: HttpRouter
Defined in: service-core/src/http/uWS/Router.ts:90
Thin Express-compatible wrapper over uWS.TemplatedApp.
Provides the same app.get(), app.post(), app.use(), etc. API that
RouteUtils.registerRoute() uses, so no changes are needed in route registration
code. Global middleware registered via use() is prepended to every route's chain.
Also supports:
ws(path, handlers)— native uWS WebSocket routinglisten(host, port)/close()— server lifecycle
Implements
Indexable
[
key:string]:any
Properties
listenPort
listenPort:
number=0
Defined in: service-core/src/http/uWS/Router.ts:100
The port the server is currently listening on (set after a successful listen() call).
Implementation of
IHttpRouter.listenPort
Accessors
isListening
Get Signature
get isListening():
boolean
Defined in: service-core/src/http/uWS/Router.ts:116
Returns true if the server is currently listening.
Returns
boolean
Implementation of
IHttpRouter.isListening
Methods
close()
close():
void
Defined in: service-core/src/http/uWS/Router.ts:362
Closes the listen socket, stopping the server from accepting new connections.
Returns
void
Implementation of
IHttpRouter.close
delete()
delete(
routePath, ...handlers):this
Defined in: service-core/src/http/uWS/Router.ts:172
Parameters
routePath
string
handlers
...RequestHandler[]
Returns
this
Implementation of
IHttpRouter.delete
get()
get(
routePath, ...handlers):this
Defined in: service-core/src/http/uWS/Router.ts:142
Parameters
routePath
string
handlers
...RequestHandler[]
Returns
this
Implementation of
IHttpRouter.get
head()
head(
routePath, ...handlers):this
Defined in: service-core/src/http/uWS/Router.ts:192
Parameters
routePath
string
handlers
...RequestHandler[]
Returns
this
Implementation of
IHttpRouter.head
listen()
listen(
host,port):Promise<void>
Defined in: service-core/src/http/uWS/Router.ts:325
Starts listening on the given host and port. Resolves when the server is ready; rejects if the port cannot be bound.
Parameters
host
string
port
number
Returns
Promise<void>
Implementation of
IHttpRouter.listen
options()
options(
routePath, ...handlers):this
Defined in: service-core/src/http/uWS/Router.ts:203
Parameters
routePath
string
handlers
...RequestHandler[]
Returns
this
Implementation of
IHttpRouter.options
patch()
patch(
routePath, ...handlers):this
Defined in: service-core/src/http/uWS/Router.ts:182
Parameters
routePath
string
handlers
...RequestHandler[]
Returns
this
Implementation of
IHttpRouter.patch
post()
post(
routePath, ...handlers):this
Defined in: service-core/src/http/uWS/Router.ts:152
Parameters
routePath
string
handlers
...RequestHandler[]
Returns
this
Implementation of
IHttpRouter.post
put()
put(
routePath, ...handlers):this
Defined in: service-core/src/http/uWS/Router.ts:162
Parameters
routePath
string
handlers
...RequestHandler[]
Returns
this
Implementation of
IHttpRouter.put
use()
use(...
handlers):this
Defined in: service-core/src/http/uWS/Router.ts:121
Register global middleware that runs before every route handler.
Parameters
handlers
...RequestHandler[]
Returns
this
Implementation of
IHttpRouter.use
ws()
ws(
routePath,handlers,wsOptions?,upgradeAuth?):this
Defined in: service-core/src/http/uWS/Router.ts:224
Registers a WebSocket route. Handlers follow the same (req, res, next) pattern
as HTTP routes; they receive req.websocket containing the uWS WebSocket handle.
upgradeAuth is an optional pre-upgrade auth function. When provided it runs synchronously
inside the uWS upgrade callback before the handshake. If it returns { reject: true },
an HTTP 401 is sent and the upgrade is aborted. If it returns { user, ... }, those
credentials are attached to the request so downstream middleware sees an authenticated user.
If it returns {}, auth falls through to the post-upgrade message-based LOGIN flow.
Both path and path + "/" are registered to avoid trailing-slash mismatch.
Parameters
routePath
string
handlers
wsOptions?
Partial<WebSocketBehavior<any>>
upgradeAuth?
Returns
this
Implementation of
IHttpRouter.ws