overleaf/services/spelling/test/acceptance/js/helpers/request.js
Eric Mc Sween f6c1e2738d Merge pull request #10938 from overleaf/em-esm-spelling
Migrate spelling to ES modules

GitOrigin-RevId: 4a200c8d1c28be44027cc8a3097e42575ab6593f
2022-12-21 09:03:55 +00:00

18 lines
441 B
JavaScript

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