Creates a RouteImpl instance that contains implementations of all methods of a route schema that can be mounted on an Express router.
RouteImpl
const TestRoute = ExpressRouteImpl(TestRouteSchema, { async get(data) { // Do stuff return { body: { message: `Testing, ${data.query.name}` } } } })
You can mount the route directly onto an Express router with:
const router = express.Router() TestRoute.mountOn(router)
The route schema to implement.
The implementations of the methods defined in the given route schema.
Generated using TypeDoc
Creates a
RouteImpl
instance that contains implementations of all methods of a route schema that can be mounted on an Express router.Example
const TestRoute = ExpressRouteImpl(TestRouteSchema, { async get(data) { // Do stuff return { body: { message: `Testing, ${data.query.name}` } } } })
You can mount the route directly onto an Express router with:
const router = express.Router() TestRoute.mountOn(router)