iopa-mount

1.4.1 • Public • Published

IOPA
iopa-mount

Build Status NPM limerun

NPM

About

Mount other IOPA applications or middleware to a given pathname

Usage

npm install iopa-mount --save
app.mount(path, function(context){});

Example

const iopa = require('iopa'),
  iopaMount = require('./index'),
  IOPA = iopa.constants.IOPA
 
var app = new iopa.App();
 
app.mount("/test", function (context, next) {
  context.log.info("HELLO WORLD");
   return Promise.resolve(null);
});
 
var demo = app.build();
 
var context = new iopa.Factory().createRequest("http://localhost/test/hello", "GET");
demo(context);
 
iopaFactory.dispose(context);

Package Sidebar

Install

npm i iopa-mount

Homepage

iopa.io

Weekly Downloads

2

Version

1.4.1

License

Apache-2.0

Last publish

Collaborators

  • tinialabs1
  • iopa-admin
  • guycreate