Socket
Book a DemoInstallSign in
Socket

@videoamp/hapi-route-autoloader

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@videoamp/hapi-route-autoloader

Loads Hapi routes according to VideoAmp Hapi project structure.

1.0.1
latest
npmnpm
Version published
Maintainers
3
Created
Source

Hapi Route Autoloader

Build Status npm version

A Hapi plugin that provides an auto-loader for Hapi routes from a specified directory.

Install

yarn

yarn add @videoamp/hapi-route-autoloader

npm

npm install --save @videoamp/hapi-route-autoloader

Setup

This package provides a Hapi plugin which loads routes according from the directory provided to the function. This allows you to customize the directory to load from on a per-project basis.

To use the Hapi plugin, you can require the package directly in server.register. An example of server setup is below:

var Hapi = require('hapi');
var server = new Hapi.Server({ port: 8000 });

server.register(require("@videoamp/hapi-route-autoloader")("controllers/"))
    .then(() => server.start());

Folder Structure

Files inside of the specified directory can export either an array of routes or a single route object. See the fixtures folder in test/ for an example.

FAQs

Package last updated on 11 Jun 2017

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.