How to add remix app to existing server at custom path? #9757
Unanswered
Nick-Minutello
asked this question in
Q&A
Replies: 1 comment
-
To answer my own question: I managed to get this to work using koa-mount & a middleware hack. koa-mount mounts the server handler at
That appears to work fine. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I want to add a remix app to an existing (koa) server.
To keep remix separated from existing functionality, I want the remix app to be at
/my-custom-path
It seems I am 90% of the way there (and I really like how remix makes it possible to integrate with an existing server).
I am setting
basename
in remix plugin conf. I am settingbase
in vite conf. I am serving client at/my-custom-path
usingkoa-mount
. My app loads & runs at/my-custom-path
- so far so good.My problems are that the server handler middleware is running at the root - so it is now interfering with all other koa routes. If I mount the server handler at
/my-custom-path
it doesn’t work - as it no longer matches the routes. (It sees/doc/123
instead of/my-custom-path/doc/123
and that doesn’t match)How can I have the server handler mounted at
/my-custom-path
or at least not interfering with existing koa routes?Is there a config setting I am missing? Or is the koa adapter for remix missing something?
Beta Was this translation helpful? Give feedback.
All reactions