Skip to content

SsrSite

Source: src/AWS/Website/SsrSite.ts

A server-rendered website behind CloudFront.

SsrSite serves a dynamic origin behind CloudFront and can optionally split immutable static assets into a private S3 bucket origin.

Lambda URL Origin

const site = yield* SsrSite("App", {
server: {
type: "lambda",
function: appFunction,
},
});

SSR With Static Assets

const site = yield* SsrSite("App", {
server: {
type: "lambda",
function: appFunction,
},
assets: {
sourcePath: "./dist/client",
},
});