2018-04-10 20:55:54 +00:00
|
|
|
created: 20180409142128584
|
|
|
|
modified: 20180409142128584
|
|
|
|
tags: HookMechanism
|
|
|
|
title: Hook: th-server-command-post-start
|
|
|
|
type: text/vnd.tiddlywiki
|
|
|
|
|
|
|
|
This hook allows plugins to extend the TiddlyWiki server command after it initializes. The two
|
|
|
|
most obvious use cases are adding routes (such as an attachments folder for external files)
|
|
|
|
to the SimpleServer instance and adding a websockets handler to the HTTP server.
|
|
|
|
|
|
|
|
Hook function parameters:
|
|
|
|
|
|
|
|
* SimpleServer instance
|
|
|
|
** Defined in core/modules/commands/server.js
|
|
|
|
* NodeJS HTTP Server instance
|
|
|
|
** See the NodeJS docs at [ext[https://nodejs.org/docs/latest-v8.x/api/http.html#http_class_http_server]]
|
2018-11-29 09:51:11 +00:00
|
|
|
* Name of server invoking this hook (for special handling of the NodeJS HTTP server instance argument).
|
|
|
|
** Current known values: `tiddlywiki`, `tiddlyserver`.
|
2018-04-10 20:55:54 +00:00
|
|
|
|
|
|
|
Return value is ignored.
|