(options, body)
| 75 | } |
| 76 | |
| 77 | function request(options, body) { |
| 78 | return new Promise((resolve, reject) => { |
| 79 | const req = http.request(options, res => { |
| 80 | resolve(res); |
| 81 | }); |
| 82 | req.on('error', e => { |
| 83 | reject(e); |
| 84 | }); |
| 85 | body.pipe(req); |
| 86 | }); |
| 87 | } |
| 88 | |
| 89 | async function renderApp(req, res, next) { |
| 90 | // Proxy the request to the regional server. |