Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fluxible-plugin-routr

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluxible-plugin-routr

A plugin for fluxible applications to provide routing methods

  • 0.3.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
45
increased by12.5%
Maintainers
5
Weekly downloads
 
Created
Source

Routr Plugin for Fluxible App

npm version Build Status Dependency Status devDependency Status Coverage Status

Provides routing methods to your Fluxible application using routr.

Usage

var FluxibleApp = require('fluxible-app');
var routrPlugin = require('fluxible-plugin-routr');
var app = new FluxibleApp();

var pluginInstance = routrPlugin({
    routes: {
        user: {
            path: '/user/:id',
            method: 'get',
            // flux-router-component uses this action when the route is matched
            action: function (actionContext, payload, done) {
                // ...
                done();
            }
        }
    }
});

app.plug(pluginInstance);

Fluxible Methods Added

actionContext

Provides full access to the routr instance. See routr docs for more information.

  • actionContext.routr.makePath(routeName, routeParams): Create a URL based on route name and params
  • actionContext.routr.getRoute(path): Returns matched route

Other Methods

The plugin also provides access to some internals and the options that were passed in.

pluginInstance.getRoutes(); // returns the full routes object passed to factory

License

This software is free to use under the Yahoo! Inc. BSD license. See the LICENSE file for license text and copyright information.

Keywords

FAQs

Package last updated on 11 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc