JsRouting is a simple JavaScript routing system with one slash route /.
- https://example.com/exampleβ
- https://example.com/:usernameβ
- https://example.com/home/exampleβ
- https://example.com/home/example/example/...β
https://cdn.jsdelivr.net/gh/im95u/JsRouting/index.js
1οΈβ£ First setup your server Apache .htaccess
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>Nginx
location / {
  try_files $uri $uri/ /index.html;
}2οΈβ£ Second Start Using JsRoute
π΄ Please make sure you use this code after the page has loaded successfully π΄
β¨ Simple Route
var jsRoute = new JsRoute();
jsRoute.get("/example", function() {
  alert("Wow! π");
});π Parameter Route
var jsRoute = new JsRoute();
jsRoute.get("/:username", function(username) {
  alert("Wow! π\nUsername : " + username);
});π Some Errors
jsRoute.get("/example/two") βjsRoute.get("/example/:parameter") βIssues section: https://github.com/im95u/JsRouting/issues
Discord: upsilun#6775
