We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dede67c commit 90a5c66Copy full SHA for 90a5c66
README.md
@@ -36,6 +36,7 @@ service.start(3000)
36
```js
37
{
38
// Optional restana library configuration (https://www.npmjs.com/package/restana#configuration)
39
+ // If the given value is a function instead of an object, it will be considered a restana service factory.
40
restana: {},
41
// Optional global middlewares in the format: (req, res, next) => next()
42
// Default value: []
index.js
@@ -10,7 +10,7 @@ const gateway = (opts) => {
10
pathRegex: '/*'
11
}, opts)
12
13
- const server = restana(opts.restana || {
+ const server = (opts.restana instanceof Function) ? opts.restana() : restana(opts.restana || {
14
disableResponseEvent: true
15
})
16
0 commit comments