mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
upgrade express
This commit is contained in:
parent
aa324a1920
commit
f069a2515d
4 changed files with 269 additions and 442 deletions
|
@ -21,15 +21,14 @@ mongojs = require "./app/js/mongojs"
|
|||
async = require "async"
|
||||
|
||||
Path = require "path"
|
||||
bodyParser = require "body-parser"
|
||||
|
||||
Metrics.mongodb.monitor(Path.resolve(__dirname + "/node_modules/mongojs/node_modules/mongodb"), logger)
|
||||
Metrics.event_loop.monitor(logger, 100)
|
||||
|
||||
app = express()
|
||||
app.configure ->
|
||||
app.use(Metrics.http.monitor(logger));
|
||||
app.use express.bodyParser({limit: (Settings.max_doc_length + 64 * 1024)})
|
||||
app.use app.router
|
||||
app.use bodyParser({limit: (Settings.max_doc_length + 64 * 1024)})
|
||||
Metrics.injectMetricsRoute(app)
|
||||
|
||||
DispatchManager.createAndStartDispatchers(Settings.dispatcherCount || 10)
|
||||
|
|
686
services/document-updater/package-lock.json
generated
686
services/document-updater/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -21,9 +21,10 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"async": "^2.5.0",
|
||||
"body-parser": "^1.19.0",
|
||||
"bunyan": "~0.22.1",
|
||||
"coffee-script": "~1.7.0",
|
||||
"express": "3.11.0",
|
||||
"express": "4.17.1",
|
||||
"lodash": "^4.17.13",
|
||||
"logger-sharelatex": "^1.7.0",
|
||||
"metrics-sharelatex": "^2.5.1",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
express = require("express")
|
||||
bodyParser = require("body-parser")
|
||||
app = express()
|
||||
MAX_REQUEST_SIZE = 2*(2*1024*1024 + 64*1024)
|
||||
|
||||
|
@ -36,7 +37,7 @@ module.exports = MockWebApi =
|
|||
else
|
||||
res.send 404
|
||||
|
||||
app.post "/project/:project_id/doc/:doc_id", express.bodyParser({limit: MAX_REQUEST_SIZE}), (req, res, next) =>
|
||||
app.post "/project/:project_id/doc/:doc_id", bodyParser({limit: MAX_REQUEST_SIZE}), (req, res, next) =>
|
||||
MockWebApi.setDocument req.params.project_id, req.params.doc_id, req.body.lines, req.body.version, req.body.ranges, req.body.lastUpdatedAt, req.body.lastUpdatedBy, (error) ->
|
||||
if error?
|
||||
res.send 500
|
||||
|
|
Loading…
Reference in a new issue