Open clone1018 opened 7 years ago
It wont be so bad if it starts off small, the hard part will be fitting it into nice eloquent Elixir code
Aspen lazy-loads routes, so when a request comes in it's parsed.
I'm wondering: since we use Plug, can we determine the legal routes to a simplate and register them on app init?
Coming back to it I love the idea of compiled routes, that'll maximize our speed.
Plug.Router is for compile-time definition of routes (as it relies on defining a patter matching functions). I don't think there's a built-in module for runtime routing.
Very beginning: https://github.com/clone1018/infuse/pull/13
Alright we now have a much better system using https://github.com/LawfulGood/infuse/tree/master/lib/http
This seems like the hardest chunk of code we need to make it to "development".
Aspen does it like: https://github.com/AspenWeb/aspen.py/blob/5d67ba6bd23d7fb1dd2756a9e751b7e963438c25/aspen/request_processor/dispatcher.py#L120