GithubHelp home page GithubHelp logo

Route conditions must be static about nancy HOT 3 CLOSED

nancyfx avatar nancyfx commented on August 27, 2024
Route conditions must be static

from nancy.

Comments (3)

grumpydev avatar grumpydev commented on August 27, 2024

I'm not sure about them having to be static, but this is definitely "by design". The idea of the route filter is to take a look at the incoming request (or the context in the context branch) and make a decision about whether the route is acceptable or not. The canonical example is being able to have a route for mobile devices, and a route for desktop devices. I'm not sure what the use case is for needing to have the module initialised to make that decision?

The fact that the module isn't initialised when the filter is run is the big advantage of the implementation. As has been discussed on the forum before, we don't want to spin up multiple modules to handle a single request, as that's expensive. It's arguably less expensive with the context additions, but it's still expensive.

Can you give some use cases why this doesn't fit the bill? Perhaps take it onto the forum for discussion - changing this is not something that should be done lightly imo.

from nancy.

thecodejunkie avatar thecodejunkie commented on August 27, 2024

lucisferre - I, like Grumpy, would love to see some real use cases for this. Could you post a couple? Thanks!

from nancy.

chrisnicola avatar chrisnicola commented on August 27, 2024

It really isn't as big a deal since the addition of the before/after filtering so I'll just close it. There really are no important use cases for this for me anymore.

from nancy.

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.