GithubHelp home page GithubHelp logo

hardenedelements / routable Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 0.0 115 KB

Platform agnostic request routing library for .NET

Home Page: https://www.nuget.org/packages/Routable/

License: MIT License

C# 98.99% HTML 1.01%
dotnet dotnet-core http kestrel routing web-application-framework web-service

routable's People

Contributors

mmaguigan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

routable's Issues

Add unit tests

This project could definitely use some serious love in the unit test department.

Allow view inclusion

Allow views to incorporate the content of other views. This may be accomplished by nesting the AST of the included view within the AST of the caller. Protip: the nested content will not expire properly when changes are detected unless written properly.

Add pattern factory method

Feature Request

Add support for pattern matching to determine if a value has a certain shape.

Proposed solution

Add an extension method with concise syntax like Add(route => route.Post().Pattern("/test/{id:guid}")

Additional context

Should support or handle uri with omitted forward slash

Line endings are not consistent

It seems the line endings throughout the project have become inconsistent. Use dos2unix and clean up the entire repository while it's young. This will dirty up git-blame.

View configuration should be enumerable

If view configuration were enumerable, a library author could offer a routing collection, extension method for adding the functionality of said library and leverage embedded views from the library assembly. All without interfering with the calling web application.

Ability to access model root

User should be able to obtain the root model regardless of nesting level (eg. within a @ForEach) using the @Root expression.

Added simple parsing engine for views

Using regular expressions for model value replacement is a quick and dirty method of providing a template engine. However, using Sprache we can have more advanced view template operations and we can add more easily.

Acceptance criteria

  1. Use Sprache to parse view templates to a tree of operations.
  2. Cache operation tree as in-memory representation of views.
  3. Render operation trees against a model on demand.
  4. Bonus, detect template updates and re-parse the view template.

Stacked routing

If multiple routes match a given request, they should be enumerated individually and each one should be processed sequentially until one of the routes successfully processes the request in full. For example, if we have four routes, and the first two are bypassable routes that return false, the third will be processed - and if that route is successfully processed the fourth will not be.

Use case

  • Authentication patterns
  • Session management
  • Authorization patterns
  • Auditing
  • Analytics

Custom view resolution

Currently the Routable.Views.Simple library resolves views using the file system. This should use a view resolution delegate with handy shortcuts for file system loading; and perhaps embedded resource streams.

Write documentation

This project is in desperate need of good documentation. Start by documenting this issue ๐Ÿ˜„

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.