Nomad
TTCTheo's Typesafe Cult
•Created by Nomad on 11/28/2023 in #questions
Next route handler send response and then continue
Hello, wondering if anyone has a solution or alternatively a decent "work around" here.
I'm working with stripe's webhooks and they want you to acknowledge that you received an event as early as possible by responding with a 200 status code, before doing any heavy/expensive tasks. (It's also a requirement in certain cases to work with the items in the event that you have acknowledged it first).
However seeing as the way I send a response in a route handler is to return from the function that's not really possible (from what I can see).
Looking for any advice on how to do this in a relatively good way.
Edit: If it's any help I am working with a newly created T3 app with the app router, trpc, and prisma.
2 replies
TTCTheo's Typesafe Cult
•Created by Nomad on 10/24/2023 in #questions
Deploying SSR Astro and Express in a docker container
Hello!
Currently have a Server Side Rendered Astro site, with PayloadCMS as a backend. The astro site is set up with the node SSR adapter.
The plan is to use the underlying express server of Payload to also work as the server to run the Astro SSR middleware from the ndoe adapter.
The issue is, I'm not exactly sure how to do this in a decent way, considering said middleware needs to be imported in the file where the express server is initialised and that can't really be done before the astro site is built. But it needs to be imported before the payload app is built.
Currently the astro and payload codebases are set up in a monorepo in separate workspaces using pnpm.
If the astro site was purely static it'd be dead easy in my dockerfile to just build it, copy the folder over and have express set up to serve that. But unfortunately I need SSR.
Thanks for any help!
1 replies