(options = {})
| 24 | }; |
| 25 | |
| 26 | const app = (options = {}) => { |
| 27 | const corsOptions = options.cors || {}; |
| 28 | const cacheOptions = options.cache || cacheDefaultConfiguration; |
| 29 | |
| 30 | const configurations = { |
| 31 | cors: { |
| 32 | ...corsDefaultConfiguration, |
| 33 | ...corsOptions, |
| 34 | }, |
| 35 | cache: cacheOptions, |
| 36 | }; |
| 37 | |
| 38 | return nc({ |
| 39 | onError, |
| 40 | onNoMatch, |
| 41 | }) |
| 42 | .use(cors(configurations.cors)) |
| 43 | .use(firewall) |
| 44 | .use(logger) |
| 45 | .use(cache(configurations.cache)); |
| 46 | }; |
| 47 | |
| 48 | export default app; |
no test coverage detected