API in Remix without resources routes #8728
sloonz
started this conversation in
Show and tell / tips
Replies: 1 comment
-
do you have any long example i'm also looking something like this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For various reasons, I wanted to use regular express for my /api/* hierarchy. I found a really nice way to integrate it, so I figure I’d share. Note that it’s using Vite.
As a simple example,
app/api.tsx
:app/entry.server.tsx
)One nice thing is you have "server-side HMR" : you don’t have to restart your server if you modify your API.
One thing that could be better : @remix/express exporting the default handleRequest instead of having to monkey-import from remix-run/dev or using remix reveal.
Beta Was this translation helpful? Give feedback.
All reactions