New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sails-hook-routefactory

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sails-hook-routefactory

a hook to provide laravel-like route generation sugar

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

sails-hook-routefactory

Build Status codecov.io

A sailsjs hook that allows a function under sails.config.routefactory to behave like laravel's routing engine.

Installation

Installing custom hooks for a sailsjs application is done by installing their npm module as a dependency of the application. Sails picks up these special packages by looking for those modules having a sails.isHook property set to true. So, to start using this hook, just run

npm i sails-hook-routefactory --save

Useage

The hook uses the sails.config.routefactory property, which can be set by creating a file underneath your application's config directory called routefactory.js. This file should look like this:

module.exports.routefactory = function(factory) {

  factory.resource('user', 'UserController');

  factory.group('admin', function() {
    factory.get('/info', 'SystemController.diagnostics');

    factory.resource('/settings', 'SystemController', {except: ['findOne', 'destroy']});
  });

  factory.route('POST /logger', 'LoggerController.create');

};

FAQs

Package last updated on 17 Mar 2016

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