Mike McCall
06/12/2021, 2:30 PMFrank
Mike McCall
06/12/2021, 7:57 PMMike McCall
06/13/2021, 5:22 PMMike McCall
06/13/2021, 5:24 PMnew cdk.CustomResource(this, "StaticSiteDeployHook", {
serviceToken: provider.serviceToken,
properties: {
bucketName: websiteBucket.bucketName,
pattern: "*.html",
replacements: {
'API_ENDPOINT': api.httpApi.apiEndpoint
}
}
})
Frank
Frank
Mike McCall
06/15/2021, 12:21 AMFrank
StaticSite
without using the s3-deployment
construct. It does the s3 upload
locally (as suggested in the blog post).Mike McCall
06/15/2021, 12:30 AMFrank
Mike McCall
06/15/2021, 12:31 AMFrank
npm run start
for your React app)Mike McCall
06/15/2021, 12:31 AMMike McCall
06/15/2021, 12:32 AMMike McCall
06/15/2021, 12:33 AMMike McCall
06/15/2021, 12:34 AMMike McCall
06/15/2021, 12:34 AMFrank
Frank
cdk-outputs.json
file?Mike McCall
06/15/2021, 12:39 AMMike McCall
06/15/2021, 12:40 AMFrank
Mike McCall
06/15/2021, 12:43 AMFrank
Mike McCall
06/15/2021, 12:45 AMFrank
npm run start
for their React app (non Amplify users)Mike McCall
06/15/2021, 5:13 AMMike McCall
06/15/2021, 1:18 PMAPI_ENDPOINT=${variable} npm run build
& output/update a local env in the statics sites source path.Frank
Frank
defaultBehavior
in v0.28.0. A couple of examples here https://docs.serverless-stack.com/constructs/StaticSite#configuring-the-default-behaviorMike McCall
06/17/2021, 2:27 PMFrank
cacheControl
settings to different files. For example, don’t cache *.html
and cache *.css *.js
forever. Example here - https://docs.serverless-stack.com/constructs/StaticSite#configure-caching
• StaticSite
now does atomic deploys. Each deployment gets deployed to a new folder in S3 bucket.
• You can specify a list of glob patterns, with the search and replace terms for each. Example here - https://docs.serverless-stack.com/constructs/StaticSite#replace-deployed-valuesFrank
process.env.API_ENDPOINT
with the deployed endpoint automatically. But when running React locally, you’d still have to replace the values urself, for now.Mike McCall
06/21/2021, 2:10 PM