mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-20 14:39:53 +01:00
a000a93dc6
* `src/node/server.js` can now be run as a script (for normal operation) or imported as a module (for tests). * Move shutdown actions to `src/node/server.js` to be close to the startup actions. * Put startup and shutdown in functions so that tests can call them. * Use `await` instead of callbacks. * Block until the HTTP server is listening to avoid races during test startup. * Add a new `shutdown` hook. * Use the `shutdown` hook to: * close the HTTP server * call `end()` on the stats collection to cancel its timers * call `terminate()` on the Threads.Pool to stop the workers * Exit with exit code 0 (instead of 1) on SIGTERM. * Export the HTTP server so that tests can get the HTTP server's port via `server.address().port` when `settings.port` is 0.
33 lines
2.6 KiB
JSON
33 lines
2.6 KiB
JSON
{
|
|
"parts": [
|
|
{ "name": "DB", "hooks": { "shutdown": "ep_etherpad-lite/node/db/DB" } },
|
|
{ "name": "Minify", "hooks": { "shutdown": "ep_etherpad-lite/node/utils/Minify" } },
|
|
{ "name": "express", "hooks": {
|
|
"createServer": "ep_etherpad-lite/node/hooks/express",
|
|
"restartServer": "ep_etherpad-lite/node/hooks/express",
|
|
"shutdown": "ep_etherpad-lite/node/hooks/express"
|
|
} },
|
|
{ "name": "static", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/static:expressCreateServer" } },
|
|
{ "name": "stats", "hooks": { "shutdown": "ep_etherpad-lite/node/stats" } },
|
|
{ "name": "i18n", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/i18n:expressCreateServer" } },
|
|
{ "name": "specialpages", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/specialpages:expressCreateServer" } },
|
|
{ "name": "padurlsanitize", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/padurlsanitize:expressCreateServer" } },
|
|
{ "name": "padreadonly", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/padreadonly:expressCreateServer" } },
|
|
{ "name": "webaccess", "hooks": { "expressConfigure": "ep_etherpad-lite/node/hooks/express/webaccess:expressConfigure" } },
|
|
{ "name": "apicalls", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/apicalls:expressCreateServer" } },
|
|
{ "name": "importexport", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/importexport:expressCreateServer" } },
|
|
{ "name": "errorhandling", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/errorhandling:expressCreateServer" } },
|
|
{ "name": "socketio", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/socketio:expressCreateServer" } },
|
|
{ "name": "tests", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/tests:expressCreateServer" } },
|
|
{ "name": "admin", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/admin:expressCreateServer" } },
|
|
{ "name": "adminplugins", "hooks": {
|
|
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/adminplugins:expressCreateServer",
|
|
"socketio": "ep_etherpad-lite/node/hooks/express/adminplugins:socketio" }
|
|
},
|
|
{ "name": "adminsettings", "hooks": {
|
|
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/adminsettings:expressCreateServer",
|
|
"socketio": "ep_etherpad-lite/node/hooks/express/adminsettings:socketio" }
|
|
},
|
|
{ "name": "openapi", "hooks": { "expressCreateServer": "ep_etherpad-lite/node/hooks/express/openapi:expressCreateServer" } }
|
|
]
|
|
}
|