mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
17 lines
463 B
CoffeeScript
17 lines
463 B
CoffeeScript
request = require("request")
|
|
settings = require("settings-sharelatex")
|
|
logger = require("logger-sharelatex")
|
|
|
|
module.exports =
|
|
|
|
getPage: (req, res)->
|
|
url = req.url
|
|
logger.log url:url, "proxying request to blog api"
|
|
request.get "#{settings.apis.blog.url}#{url}", (err, r, data)->
|
|
console.log data
|
|
try
|
|
data = JSON.parse(data)
|
|
catch err
|
|
logger.err err:err, data:data, "error parsing data from data"
|
|
res.render "blog/#{data.layout}", data
|
|
|