Frank
sst.Api
now supports catch-all route in v0.36.0. Just add an $default
route like this:
new Api(this, "Api", {
routes: {
"GET /notes" : "src/list.main",
"POST /notes": "src/create.main",
"$default" : "src/default.main",
},
});
📢 Update 2
sst.Api
now supports HTTP proxy integration. You can point an Api route to a public url:
new Api(this, "Api", {
routes: {
"GET /": {
url: "<http://api.mydomain.com>",
},
},
});
Dennis Dang
07/29/2021, 4:23 PM