overleaf/services/spelling/test/acceptance/js/helpers/request.js

19 lines
441 B
JavaScript
Raw Normal View History

import { promisify } from 'util'
import Request from 'request'
export const PORT = 3005
const BASE_URL = `http://${process.env.HTTP_TEST_HOST || '127.0.0.1'}:${PORT}`
const request = Request.defaults({
baseUrl: BASE_URL,
headers: {
2021-07-13 07:04:47 -04:00
'Content-Type': 'application/json',
},
2021-07-13 07:04:47 -04:00
followRedirect: false,
})
export const get = promisify(request.get)
export const post = promisify(request.post)
export const del = promisify(request.del)