-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: deploy aws / add streaming #910
feat: deploy aws / add streaming #910
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
sst.config.ts: /// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: "waku03demo",
removal: input?.stage === "production" ? "retain" : "remove",
home: "aws",
};
},
async run() {
const WakuDemoApp = new sst.aws.Function("WakuDemoApp", {
url: true,
streaming: true,
//timeout: "15 minutes",
handler: "dist/serve-aws-lambda.handler",
bundle: "bundle", // disable bundling with esbuild
copyFiles: [
{
from: "dist"
},
{
from: "private"
}
],
environment: {
NODE_ENV: "production",
},
});
return {
api: WakuDemoApp.url,
};
},
});
~ |
@rmarscher it works now please provide some input why you need to rearrange the dist folder. The sst setup above is only the shortest version to test streaming, other setups should not be a problem. |
Very cool. Thanks for giving SST a try. I rearrange the files to move unnecessary public files out of the function bundle - to reduce the lambda package size. |
Here is a demo I made for how I use SST with waku with an older patch of v0.21.1 - https://github.com/rmarscher/waku-sst-demo |
@rmarscher in the serverless framework I only copy the needed folders to the lambda and all static files go to an s3 bucket. In Cloudfront I use behaviors to handle the forwarding of static requests and the default request are handled by the lambda function. I know this is not as fancy as using a Cloudfunction to route all static assets but deployments in non It should be possible keep the current file structure with the sst framework. Looking at TanstackStart Stack I suggest that @dai-shi asks directly asks for support in creating the stack. Tanstack sst stack was created by Frank Wang the founder of sst. @rmarscher if you agree, I would finish this PR as creating an sst stack should be in its own PR. |
4619f1e
to
63bae1b
Compare
What should I do? Open an issue? |
yes, and maybe ping Frank to have a look at WAKU as one of the best alternatives to Next.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good other than that. needs to run prettier?
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
adds streaming by using
streamHandle
from Hono.To switch the handler use the environment variable
DEPLOY_AWS_LAMBDA_STREAMING=true
: