2022-12-20 07:11:25 -05:00
|
|
|
import { promisify } from 'util'
|
|
|
|
import Request from 'request'
|
2019-07-09 14:12:30 -04:00
|
|
|
|
2022-12-20 07:11:25 -05:00
|
|
|
export const PORT = 3005
|
2019-07-09 14:12:30 -04:00
|
|
|
|
2024-04-25 08:56:00 -04:00
|
|
|
const BASE_URL = `http://${process.env.HTTP_TEST_HOST || '127.0.0.1'}:${PORT}`
|
2019-07-09 14:12:30 -04:00
|
|
|
|
2022-12-20 07:11:25 -05:00
|
|
|
const request = Request.defaults({
|
2019-07-09 14:12:30 -04:00
|
|
|
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
|
|
|
})
|
|
|
|
|
2022-12-20 07:11:25 -05:00
|
|
|
export const get = promisify(request.get)
|
|
|
|
export const post = promisify(request.post)
|
|
|
|
export const del = promisify(request.del)
|