overleaf/services/document-updater/test/acceptance/coffee/helpers/MockTrackChangesApi.coffee

21 lines
416 B
CoffeeScript
Raw Normal View History

express = require("express")
app = express()
module.exports = MockTrackChangesApi =
flushDoc: (doc_id, callback = (error) ->) ->
callback()
run: () ->
app.post "/project/:project_id/doc/:doc_id/flush", (req, res, next) =>
@flushDoc req.params.doc_id, (error) ->
if error?
res.send 500
else
res.send 204
2014-10-07 07:31:16 -04:00
app.listen 3015, (error) ->
throw error if error?
MockTrackChangesApi.run()