diff --git a/core/language/en-GB/Help/server.tid b/core/language/en-GB/Help/server.tid index ef900b5bd..0f2b0e63a 100644 --- a/core/language/en-GB/Help/server.tid +++ b/core/language/en-GB/Help/server.tid @@ -6,7 +6,7 @@ The server built in to TiddlyWiki5 is very simple. Although compatible with Tidd At the root, it serves a rendering of a specified tiddler. Away from the root, it serves individual tiddlers encoded in JSON, and supports the basic HTTP operations for `GET`, `PUT` and `DELETE`. ``` ---server +--server ``` The parameters are: @@ -18,6 +18,7 @@ The parameters are: * ''username'' - the default username for signing edits * ''password'' - optional password for basic authentication * ''host'' - optional hostname to serve from (defaults to "127.0.0.1" aka "localhost") +* ''pathprefix'' - optional prefix for paths If the password parameter is specified then the browser will prompt the user for the username and password. Note that the password is transmitted in plain text so this implementation isn't suitable for general use. diff --git a/core/modules/commands/server.js b/core/modules/commands/server.js index eb78bfa67..e724aa53f 100644 --- a/core/modules/commands/server.js +++ b/core/modules/commands/server.js @@ -50,10 +50,22 @@ SimpleServer.prototype.addRoute = function(route) { }; SimpleServer.prototype.findMatchingRoute = function(request,state) { + var pathprefix = this.get("pathprefix") || ""; for(var t=0; t