2019-07-09 14:12:30 -04:00
|
|
|
const { promisify } = require('util')
|
|
|
|
|
|
|
|
const PORT = 3005
|
|
|
|
|
2020-06-03 04:52:36 -04:00
|
|
|
const BASE_URL = `http://${process.env.HTTP_TEST_HOST || 'localhost'}:${PORT}`
|
2019-07-09 14:12:30 -04:00
|
|
|
|
|
|
|
const request = require('request').defaults({
|
|
|
|
baseUrl: BASE_URL,
|
|
|
|
headers: {
|
2021-07-13 07:04:47 -04:00
|
|
|
'Content-Type': 'application/json',
|
2019-07-09 14:12:30 -04:00
|
|
|
},
|
2021-07-13 07:04:47 -04:00
|
|
|
followRedirect: false,
|
2019-07-09 14:12:30 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
PORT,
|
|
|
|
get: promisify(request.get),
|
|
|
|
post: promisify(request.post),
|
2021-07-13 07:04:47 -04:00
|
|
|
del: promisify(request.del),
|
2019-07-09 14:12:30 -04:00
|
|
|
}
|