Open NamesMT opened 5 months ago
Example snippet of the routes usage:
const backend = new sst.aws.Function('Backend', {
url: true,
handler: 'apps/backend/src/index.handler',
})
const staticSiteDistribution = new sst.aws.StaticSite('StaticFullstack', {
build: {
command: 'pnpm run build --filter="frontend"',
output: 'apps/frontend/.output/public',
},
routes: {
'/api/*': backend.url,
},
})
This deploys my starter-fullstack template to Cloudfront, with the static frontend and Hono backend served on the same domain, with working Live development access from Cloudfront's url.
Note: this update if merged as-is will remove and re-create the distribution for existing deploys.
Love it when someone already has a PR for something i wanted to add. +1
Refactored to use
Router
under-the-hood :D, tested locally with working dev, HMR, deploy. Resolves #311Tested used without routes arg. (like current) Tested with routes from APIGatewayV2, Function