My purpose is build web applications on top of the out-of-box TiddlyWiki module (‘npm install tiddlywiki’). TiddlyWiki ‘server’ edition provides the required synchronization between browser front-end and the server side wiki.
The first step to add application specific features to server side ‘server’ edition is to create a tiddler with module-type ‘route’. See built-in tiddler $:/core/modules/server/routes/get-favicon.js
as an example of what a ‘route’ tiddler looks like.
Simple enough. So add a module-type: ‘route’ tiddler with the following (… in place of details):
exports.method = "GET";
exports.path = /^\/addtag\/.../;
exports.handler = function(request,response,state) { ... }
which is a route to have the server add a tag to a tiddler. Silly, but as an example. Path would be ‘/addtag/:tiddler/:tag’.
Here is where I am probably incorrect. To add the app specific /addtag
HTTP request browser side; I need to override the $:/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js
shadow tiddler to implement the new route, by adding :
TiddlyWebAdaptor.prototype.addTag = function() { ... }
Is my head too deep in the weeds - or is there a way to add the route HTTP request brower side without overriding a shadow tiddler?