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

21 lines
416 B
JavaScript
Raw Normal View History

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