Will you guys be adding a single page app construc...
# sst
r
Will you guys be adding a single page app construct?
For React apps etc.
f
Yeah.. definitely something we’ve been thinking
How are you deploying ur SPA now?
r
I do it via serverless
I create an s3 bucket, upload code to it and put it behind cloud front, I also create a second cloud front to do a www-> non www redirect
f
I see. Does the plugin handle the build process, or do you have to manually build first?
r
I run yarn build, then serverless deploy as part of a CI build
The single-page-plugin I made, syncs files to s3, and invalidates cloud front cache
These are not done by serverless cli
f
Opened an discussion here for ppl to throw some ideas at it https://github.com/serverless-stack/serverless-stack/discussions/194
Hey @Roger Rajaratnam, I’m taking a crack at the SPA construct. Currently, people have 1 app for the backend, and 1 app for the SPA. They would deploy their backend first, then copy over the deployed api url and other CF output to their SPA’s config file, and then deploy the SPA. We want to remove this manual step, so you can have just 1 app and the deployed URL automatically gets passed into the SPA construct. Can you take a quick look at the “Cross stack reference” section of the spec and let me know what you think? https://github.com/serverless-stack/serverless-stack/discussions/194
r
Hey Frank, apologies for not coming back to you on this, haven't been on this slack for a while.
f
Hey @Roger Rajaratnam, welcome back haha. Yeah we’ve released a fleet of frontend constructs https://docs.serverless-stack.com/frontend
r
Yep I saw and I'm using it to deploy a Gatsby site using it at the moment.