3.5.0 • Published 9 years ago

springbokjs-router v3.5.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

springbokjs-router NPM version Build Status Coverage

browser support

See the auto-generated docs

How to use

var SpringbokRouter = require('springbokjs-router');

var RouterBuilder = SpringbokRouter.RouterBuilder;
var RoutesTranslations = SpringbokRouter.RoutesTranslations;

var routesLangs = {
    login: {
        en: 'login',
        fr: 'connexion'
    },
    post: {
        en: 'post',
        fr: 'article'
    },
    'view': {
        en: 'view',
        fr: 'afficher'
    }
};
var routesTranslations = new RoutesTranslations(routesLangs);

var builder = new RouterBuilder(routesTranslations, ['en', 'fr']);
module.exports = builder.router;

builder
    .add('/', '/', 'site.index')
    .add('postView', '/post/:id-:slug', 'post.view', {
        namedParamsDefinition: {'slug': '[A-Za-z\-]+'},
        extension: 'htm'
    })
    .addDefaultRoutes();

Missing before 1.0.0:

  • better handle of array to route : RouterRouteLang.strf is not ideal. Especially with routes like '.../*' or route with optional parts
3.5.0

9 years ago

3.4.2

9 years ago

3.4.1

9 years ago

3.4.0

9 years ago

3.3.0

9 years ago

3.2.0

10 years ago

3.1.0

10 years ago

2.2.0

10 years ago

2.1.0

10 years ago

2.0.3

10 years ago

2.0.2

10 years ago

2.0.0

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago