UNPKG

639 BJavaScriptView Raw
1const { join } = require('path')
2const cors = require('./cors')
3const endpoints = require('./endpoints')
4const { mappings: coverage } = require('./coverage')
5const ui5 = require('./ui5')
6const { check } = require('reserve')
7const unhandled = require('./unhandled')
8
9module.exports = async job => check({
10 port: job.port,
11 mappings: [
12 cors,
13 ...job.mappings ?? [],
14 ...job.serveOnly ? [] : endpoints(job),
15 ...ui5(job),
16 ...await coverage(job), {
17 // Project mapping
18 match: /^\/(.*)/,
19 file: join(job.webapp, '$1'),
20 strict: true,
21 'ignore-if-not-found': true
22 },
23 ...unhandled(job)
24 ]
25})