Michael Wolfenden
07/07/2021, 2:29 AMapi
, is there anyway to retrieve the routes it was configured with?Frank
Frank
Michael Wolfenden
07/07/2021, 3:05 AMconst apiProps: ApiProps = {
...
}
const api = new sst.Api(scope, 'api', apiProps)
const routes = apiProps.routes
addAlarms(scope, routes)
addDashboard(scope, routes)
rather than
const api = new sst.Api(scope, 'api', {
...
})
const routes = apiProps.routes
addAlarms(scope, routes)
addDashboard(scope, routes)
Frank
api.routes
returned
[
"GET /notes",
"GET /notes/{noteId}",
...
]
Would that work for you?Michael Wolfenden
07/07/2021, 3:22 AMrouteKeys
are enough, that way I can call api.getFunction
Frank
Frank
Frank
api.routes
will give you all the route keys.