1 2 3 4 5 6 7 8 9 10 11 12 13 | 1x 1x 1x 1x 1x | const request = require('request-promises'); const extend = require('extend'); const port = require('./helpers/port'); module.exports = opts => async ctx => { return await request(extend({}, { url: `http://localhost:${ctx.options.port}${opts.path || '/'}`, method: 'GET', }, opts)); }; module.exports.get = (path, opts) => module.exports({ method: 'GET', path, opts }); |