Skip to content
Mount other IOPA applications or middleware to a given pathname
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
src
test
tools
typings
.gitignore
LICENSE
NOTICE
README.md
demo.js
index.js
jsconfig.json
package.json
shippable.yml

README.md

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);
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.