Comments (5)
I started a thread in the effect discord. Let's confirm with Tim whether this is something to be fixed in the @effect/platform. If yes, let's do the adjustment in the @effect/platform and the fix here will be to update. If no, maybe there will be a way to check the mount path or something to make it work with mountApp
. Otherwise, we'll need provide a way to configure the base path as you proposed.
from effect-http.
Hey, yes, I can reproduce. I was solving a similar issue already but using HttpServer.router.mount
(my use case is that I want to mount the swagger router without the whole effect-http machinery). With HttpServer.router.mount
, the prefix
is propagated within the HttpServer.router.RouteContext
which the swagger router uses to generate the correct path in the index.html
. The HttpServer.router.mountApp
doesn't seem to do so.
from effect-http.
Thanks for the quick response @sukovanej, I could definitely see being able to split it out into it's own handler so you can compose things as you see fit.
Regarding mount vs mountApp, it kinda sounds like a bug if mountApp doesn't propagate all relevant route information, no?
from effect-http.
Hey, I resolved it by introspecting the originalUrl
on the request and calculating the prefix based on that. Please try to update to the latest version, it should start working with both mount
and mountApp
now.
from effect-http.
@sukovanej I can confirm it works great! Thank you for your help 🙏
from effect-http.
Related Issues (20)
- Array of query parameters HOT 3
- Issues resolving OpenAPI components with subset of `Schema.optional` API HOT 3
- error due to missing peerDep of isomorphoc-ws when using yarn 4 in pnp mode HOT 2
- Feature Request: Optional Security Scheme HOT 3
- Optional API routes HOT 5
- How to mount an API under a base path HOT 5
- Swagger Example generation for Dates in Schema HOT 4
- Feature Request: Client should return all expected status codes HOT 1
- Create separate lib for Security ("Auth"?) module. HOT 3
- [IDEA] Integration with Express HOT 2
- Client includes server code
- [QUESTION]: Adding Groups endpoints and Build Routes in a modular way HOT 3
- Handle EADDRINUSE HOT 2
- Improve type error reporting HOT 2
- Embeddable examples similar to Hono? HOT 1
- Services in Security implementation is leaked into the client HOT 1
- Handling multiple response types HOT 3
- Generate a msw mock server for testing HOT 1
- Adding a cli
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from effect-http.