All Projects → SME-FE → Sme Router

SME-FE / Sme Router

Licence: mit
A lightweight router lib that implement with express route style

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Sme Router

React Resource Router
Configuration driven routing solution for React SPAs that manages route matching, data fetching and progressive rendering
Stars: ✭ 136 (+21.43%)
Mutual labels:  router, spa
Angular
UI-Router for Angular: State-based routing for Angular (v2+)
Stars: ✭ 287 (+156.25%)
Mutual labels:  router, spa
Redux Tower
Saga powered routing engine for Redux app.
Stars: ✭ 155 (+38.39%)
Mutual labels:  router, spa
Universal Router
A simple middleware-style router for isomorphic JavaScript web apps
Stars: ✭ 1,598 (+1326.79%)
Mutual labels:  router, spa
Jsoo router
A small router to write easily single-page-app in Js_of_ocaml
Stars: ✭ 24 (-78.57%)
Mutual labels:  router, spa
xRoute
一个小型的前端路由库✈️
Stars: ✭ 36 (-67.86%)
Mutual labels:  spa, router
Frontexpress
An Express.js-Style router for the front-end
Stars: ✭ 263 (+134.82%)
Mutual labels:  router, spa
Abstract State Router
Like ui-router, but without all the Angular. The best way to structure a single-page webapp.
Stars: ✭ 288 (+157.14%)
Mutual labels:  router, spa
React
🔼 UI-Router for React
Stars: ✭ 386 (+244.64%)
Mutual labels:  router, spa
Miox
Modern infrastructure of complex SPA
Stars: ✭ 374 (+233.93%)
Mutual labels:  router, spa
Webvr Webpack Boilerplate
A webvr multi-scenes Single-page application for three.js, webpack
Stars: ✭ 47 (-58.04%)
Mutual labels:  router, spa
Vanilla Ui Router
Simple vanilla JavaScript router
Stars: ✭ 42 (-62.5%)
Mutual labels:  router, spa
Routegen
Define your API and SPA routes in one place. Use them anywhere. Only 1.3kb.
Stars: ✭ 86 (-23.21%)
Mutual labels:  router, spa
Routes
typed bidirectional routes for OCaml/ReasonML web applications
Stars: ✭ 102 (-8.93%)
Mutual labels:  router
Gin
Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
Stars: ✭ 53,971 (+48088.39%)
Mutual labels:  router
Xunleikuainiaoinshell
[ 迅雷快鸟 Shell 版 ] A Shell Implementation of Kuainiao, Xunlei
Stars: ✭ 102 (-8.93%)
Mutual labels:  router
Pc Engines Apu Router Guide
Guide to building a Linux or BSD router on the PC Engines APU platform
Stars: ✭ 101 (-9.82%)
Mutual labels:  router
Pilot
Pilot — multifunction JavaScript router.
Stars: ✭ 109 (-2.68%)
Mutual labels:  router
Router.js
Router.js is a simple and powerful javascript library to handle routing
Stars: ✭ 107 (-4.46%)
Mutual labels:  router
Iceworld
tonado的multi-thread 多线程封装
Stars: ✭ 99 (-11.61%)
Mutual labels:  router

SME Router

A lightweight router lib that implement with express route style

Travis branch coverage download version license

Languages

Documentation

Get Start

Installation

npm i --save sme-router

Usage

Edit sme-router example

index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>SME Router</title>
</head>
<body>
  <div id="app">
    <div id="router-view"></div>
  </div>
</body>
</html>

import SMERouter from 'sme-router'

const router = new SMERouter('router-view')

// route config
router.route('/index', (req, res, next) => {
  res.render(
    `hallo world`
  )
})

router.route('*', (req, res, next) => {
  res.redirect('/index')
})

Note: if your are not using webpack, your can simply import it to your html file

<script type="text/javascript" src="https://unpkg.com/sme-router"></script>

Please see the document for more details

Live demo

click me to see the demo

Running Example

1.clone the repo

npm i
npm run dev

open http://localhost:8080/

2.Test

npm run test // or => karma start

3.lint

npm run lint

Contributors

Thanks goes to these wonderful people (emoji key):


hwen

🤔 💻 🎨 📖 💡

License

MIT License

Copyright (c) 2017-present, hwen [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].