hapi-loader

hapi loader helpers

Usage no npm install needed!

<script type="module">
  import hapiLoader from 'https://cdn.skypack.dev/hapi-loader';
</script>

README

hapi-loader

Build Status Current Version

Some load utils for hapi

Installation

    npm install hapi-loader

Usage


    var Loader = require('hapi-loader');

Input is a relative or complete path to routes, the directory structure must contain folders called endpoints and handlers, see the example in test/fixtures directory

    var routes = Loader.loadRoutes(directory);

Routes will be an array of routes which can be passed to hapi's server.routes() method for registering

    var schemas = Loader.loadSchemas(directory);

Schemas will be an object contain schemas for loading by a plugin's addSchemas method