mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
7cbf2cdd9e
Enable the eslint dot-notation rule GitOrigin-RevId: e11cbad3e8a77a4a60590d3674fbf34feccc5bc9
23 lines
573 B
JavaScript
23 lines
573 B
JavaScript
// TODO: This file was created by bulk-decaffeinate.
|
|
// Sanity-check the conversion and remove this comment.
|
|
const BASE_URL = `http://${process.env.HTTP_TEST_HOST || 'localhost'}:3000`
|
|
const request = require('request').defaults({
|
|
baseUrl: BASE_URL,
|
|
followRedirect: false
|
|
})
|
|
|
|
module.exports = request
|
|
|
|
module.exports.promises = {
|
|
request: function(options) {
|
|
return new Promise((resolve, reject) => {
|
|
request(options, (err, response) => {
|
|
if (err) {
|
|
reject(err)
|
|
} else {
|
|
resolve(response)
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|