Page Contents
Home > @loopback/rest > RestApplication > mountExpressRouter
RestApplication.mountExpressRouter() method
Mount an Express router to expose additional REST endpoints handled via legacy Express-based stack.
Signature:
mountExpressRouter(basePath: string, router: ExpressRequestHandler, spec?: RouterSpec): void;
Parameters
| Parameter | Type | Description |
|---|---|---|
|
basePath |
string |
Path where to mount the router at, e.g. |
|
router |
ExpressRequestHandler |
The Express router to handle the requests. |
|
spec |
(Optional) A partial OpenAPI spec describing endpoints provided by the router. LoopBack will prepend |
Returns:
void