Code Monkey home page Code Monkey logo

Comments (5)

sukovanej avatar sukovanej commented on July 30, 2024 1

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.

sukovanej avatar sukovanej commented on July 30, 2024

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.

TylorS avatar TylorS commented on July 30, 2024

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.

sukovanej avatar sukovanej commented on July 30, 2024

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.

TylorS avatar TylorS commented on July 30, 2024

@sukovanej I can confirm it works great! Thank you for your help 🙏

from effect-http.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.