2014-01-27 12:51:09 -05:00
|
|
|
Settings = require "settings-sharelatex"
|
2013-08-23 09:35:13 -04:00
|
|
|
logger = require "logger-sharelatex"
|
|
|
|
logger.initialize("history")
|
|
|
|
|
2014-01-27 13:09:37 -05:00
|
|
|
HttpController = require "./app/js/HttpController"
|
|
|
|
express = require "express"
|
|
|
|
app = express()
|
|
|
|
|
|
|
|
app.post "/doc/:doc_id/history", express.bodyParser(), HttpController.appendUpdates
|
2013-08-23 09:35:13 -04:00
|
|
|
|
|
|
|
app.use (error, req, res, next) ->
|
|
|
|
logger.error err: error, "an internal error occured"
|
|
|
|
req.send 500
|
|
|
|
|
2014-01-27 12:51:09 -05:00
|
|
|
app.listen (Settings.port ||= 3014), (error) ->
|
|
|
|
if error?
|
|
|
|
logger.error err: error, "could not start history server"
|
|
|
|
logger.log "history api listening on port 3014"
|
|
|
|
|