-
-
Notifications
You must be signed in to change notification settings - Fork 171
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: add serverless application example #303
Conversation
Hey @vjcspy, thanks for your PR! Can you please import something from the monorepo in your app, like foo/meaningOfLife and make sure it correctly uses the path aliases? Also, you can remove the jest and dotenv stuff since I like to keep examples focused only on one thing. jest is already covered in apps/jest. If you make sure the monorepo imports work, I can take care of cleaning up the rest. Thanks! |
Thanks for you response. I refactored to make it as simple as possible. Removed jest + dotenv, also used alias path in handler.ts to import app.ts. |
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.
For some reason GitHub is not triggering the workflow for this PR, otherwise it would have caught a bunch of lint errors. Please run all of these locally and make sure they pass.
Thanks for updating this @vjcspy. I rebased the PR to solve lockfile conflicts and cleaned up a few things (you're going to have to do a force pull). There are still some issues however. First of all, it looks like
Secondly, running the
Trying to access the server at
Can you please look into the above? Moreover, I would need some guidance on how to test this locally, and deploy it (to AWS I assume?). If I'm going to merge this example and maintain it, I need to understand what it does and how to work with it. |
Hi @NiGhTTraX, All of the above issues are caused by pnpm not installing express dependencies. You can check out express's package.json file and see that it relies a lot on other libraries (react, nextjs doesn't). There are 2 options to solve this problem:
Deploying to AWS is very simple. Follow this document to configure AWS profile, then just run
|
@NiGhTTraX
Also, I can switch to serverless-webpack. Actually, serverless-bundle uses the serverless-webpack plugin. Then I thought it would be better because we won't include unnecessary things. |
@vjcspy if you can resolve the express issues and remove the React dependency then I'll take another look at this. It MUST work with pnpm's default config. |
this pr add an example for serverless application. Some points of interest:
serverless-offline
webpack
jest
dotenv