Javascript routing library?

I used Backbone.js as a lightweight MVC framework that has built-in routing support. Now I have moved and am currently using Agility.js, which does not support routing. So my question is: is there an alternative to Backbones.js tracing?

For help on why I need this, because my "style" of writing is a one page website that the server requests for information.

+6
source share
3 answers

I came across the same issue a few weeks ago and wrote "Simrou" - a very basic structure that does nothing but such a hash-based routing. You can define routes in your own Backbone style, and then attach action handlers to GET, POST, PUT requests, etc. (GET is basically a click link, POST, etc. It can be caused by forms).

https://github.com/buero-fuer-ideen/Simrou

+5
source

You don’t know what features you are looking for, but I just set up a very lightweight JS router that offers a minimum minimum so that everything is in order. Many of the routers I came across offered more options than I was looking for, so I thought it might help fill the void for those who are looking for something bright. By default, pushState is used, it returns to the hash. http://gabehayes.github.com/lennonjs/ .

+3
source

Another variant of Davis.js provides simple pushState -based routing (it can also work with hash-based routing). It is inspired by Sammy.js, but focuses only on the routing side.

+2
source

Source: https://habr.com/ru/post/911604/


All Articles