Public | Automated Build

Last pushed: 11 days ago
Short Description
Short description is empty for this repo.
Full Description

Rapptor

Rapptor is a lightweight library that sits on top of hapi.

Features

Install

npm install --save rapptor

Usage:

Add the following to your package.json:

{
  "scripts": {
    "start": "rapptor"
  }
}

Then run: npm start

Adding a plugin

Open up conf/default.yaml and add the following:

plugins:
  hapi-plugin-name:
    someOption: "someValue"

See more information on configuration in hapi-confi.

Adding a route

Add a file: routes/someroute.js and add the following:

exports.homepage = {
  path: '/',
  method: 'GET'
  handler(request, reply) {
    reply('homepage!');
  }
}

Now if you go to http://localhost:8080/ you should see homepage!.

See more information on route loading in hapi-route-loader.

Adding a method

Add a file: methods/somemethod.js and then add the following:

module.exports = {
  method(arg, done) {
    //some stuff
    done();
  }
}

Now you can call server.method.somemethod() in your code.

See more information on method loading in hapi-method-loader.

Docker Pull Command
Owner
firstandthird
Source Repository

Comments (0)