Giter VIP home page Giter VIP logo

Comments (5)

hueniverse avatar hueniverse commented on August 21, 2024

You can do this now with onPreResponse extension. Not as clean as a native extension to this module where you can specify an error handler fallback. But also not sure if it's worth the complexity here. I'll let @kanongil decide.

from inert.

digitaldesigndj avatar digitaldesigndj commented on August 21, 2024

Thanks for the help, that's exactly what I needed. There's a little bit of new route detection that I had to do, but it may actually be cleaner this way.

That could just be because my app is small right now however.

from inert.

kanongil avatar kanongil commented on August 21, 2024

I agree with the approach @hueniverse offered, though I would probably use a plain directory handler, and handle the proxy behavior in the onPreResponse hook.

To detect when to apply this behavior, as the hook is called for all routes, you can use the app route config, which can be accessed from the extension point handler via request.route.settings.app.

I will leave this request open for now in case others want to chime in but I don't really think it is worth the effort to include this functionality in inert.

from inert.

digitaldesigndj avatar digitaldesigndj commented on August 21, 2024

I did look at onPreResponse I can't still say for sure why I didn't take that route, but I can say that I looked at it for a bit. I can say also that this proxy stuff is super helpful when injecting node.js into a stale corporate environment. Even if the application was small, it came together quick.

This app really tears the face off of a bad site, and it's gonna take a crowbar to get this sucker off.

from inert.

lock avatar lock commented on August 21, 2024

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

from inert.

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.