0.1.17 • Published 4 years ago
bodega-js v0.1.17
Bodega-Js
Abstracts all the code involved in writing a Hapi server from scratch. All you have to do is include the bodega-js module, instantiate the HttpServer with a simple confiuration object, then start!
Requirements
- node >=12
Installation
npm i --save bodega-js
Usage
const HttpServer = require('bodega-js').Server;
const httpServer = new HttpServer({
port: 8080 // Whichever port you want the server to run on
routes: [/* hapi v18 routes */],
logger, // used for error reporting and status updates outside of request logging
swagger: { // optional
title: 'A title for your documentation'
pathPrefix: 'A prefix for your documentation routes (e.g. /v1)',
disabled: false, // optional, default false
includeAuth: true // optional, default true. displays a field in the header for entering your jwt token
}
});
await httpServer.start();
await waitForDone();
await httpServer.stop();
Copyright
Copyright © 2019 AJ LaBarre, all rights reserved.