thumbsville

4.0.0 • Public • Published

Thumbsville

Organize your Hapi app with route packs that allow you to separate sections of the app called hoods.

NPM

Easy setup

Add Thumbsville to your Hapi project as a dependency in your package.json

npm install thumbsville --save

Configuration

Route packs are located automatically just by giving the root folder. In this example all subfolders under ./hoods will be searched for route packs.

var Thumbsville = require('thumbsville');
 
Thumbsville.viewOptions = function(plugin){ 
    return { 
        engines: {
            html: {
                module: require('handlebars').create()
            }
        }, 
        path: './views', 
        layoutPath: './layouts', 
        layout: 'master',
        helpersPath: './helpers'
    };
};
 
Thumbsville.findRoutePacks(server /* Hapi server */, './hoods');

Shared paths

Shared paths allow you to have local content for each hood but still keep shared views, layouts, helpers and partials in one place.

Thumbsville.sharedPaths = __dirname + '/common';

Add this before calling Thumbsville.findRoutePacks to use shared and local paths for all view related content. In this example, the path property of viewOptions would have /common/views appended to the view search list for all views in that hood.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 4.0.0
    0
    • latest

Version History

Package Sidebar

Install

npm i thumbsville

Weekly Downloads

8

Version

4.0.0

License

MIT

Last publish

Collaborators

  • robby