apeman-middleware-proxy
v1.0.4
Published
apeman middleware package for proxy
Downloads
15
Readme
apeman-middleware-proxy
apeman middleware package for proxy
Installation
$ npm install apeman-middleware-proxy --save
Usage
create an middleware instance and attach to server settings like $api
of apeman projects.
Apemanfile.js
/** This is an example Apemanfile to use apeman-middleware-proxy */
'use strict'
module.exports = {
$pkg: { /* ... */ },
$ui: {
/* ... */
$serverMiddlewares: [
require('apeman-middleware-proxy')('/api/*', {
target: {
host: 'localhost',
port: 3001
}
})
]
}
}
Signature
apemanMiddlewareProxy(pattern, config) -> function
Create an middleware function
Args
| Name | Type | Default | Description | | --- | ---- | --- | --- | | pattern | string | | URL pattern to apply proxy. | | config | object | | Proxy configuration. |
License
This software is released under the MIT License.