Peter Slattery
04/25/2022, 11:36 AMthis.api = new sst.Api(
this,
"api-name",
{
customDomain: {
path: "v2"
}
}
);
Hans Song
04/25/2022, 11:15 PMthis.api = new sst.Api(
this,
"api-name",
{
routes: {
"GET /v2/xyz": ...
}
}
)
add the url to the outputs to see it
this.addOutputs({
apiUrl: this.api.url
})
as far as i’m aware there’s no way to set a default path with http api, you could with the v1 rest apiFrank
v2
), you can accomplish what u want. Here’s an example https://docs.serverless-stack.com/constructs/v1/Api#cdkhttpstagesFrank
Frank
/v2
as @Hans Song suggested.Frank