mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
14 lines
353 B
CoffeeScript
14 lines
353 B
CoffeeScript
|
settings = require("settings-sharelatex")
|
||
|
logger = require("logger-sharelatex")
|
||
|
request = require("request")
|
||
|
|
||
|
module.exports = (req, res, next)->
|
||
|
requestedUrl = req.url
|
||
|
|
||
|
redirectUrl = settings.proxyUrls[requestedUrl]
|
||
|
if redirectUrl?
|
||
|
logger.log redirectUrl:redirectUrl, reqUrl:req.url, "proxying url"
|
||
|
request(redirectUrl).pipe(res)
|
||
|
else
|
||
|
next()
|