mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
a540754f6e
[misc] bulk replace localhost with 127.0.0.1 GitOrigin-RevId: d238f3635302e8ff5500d611108c4d1bef216726
18 lines
441 B
JavaScript
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 || '127.0.0.1'}:${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)
|