Preparation
The first step is to ensure the handler
export is removed from the backend/index.ts
file. Our projects add a line in that looks like this:
// Remove this line!
export const handler = graphweaver.handler();
This is what tells Graphweaver to use Lambda as the deployment target.
Once you’ve removed that line, you’ll be running in Fastify, both locally and when you build.
Build
Now you can build the server with pnpm build
. The backend will land as a single bundled JS file in dist/backend/index.js
Run
Running node index.js
with the built file should result in your server being up. You can now deploy this file and run / manage it however you like!