mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-28 15:08:46 +00:00
Server: include path-prefix in display URL
This commit is contained in:
parent
6aab4d5524
commit
810033bd71
@ -232,17 +232,19 @@ Server.prototype.requestHandler = function(request,response) {
|
|||||||
/*
|
/*
|
||||||
Listen for requests
|
Listen for requests
|
||||||
port: optional port number (falls back to value of "port" variable)
|
port: optional port number (falls back to value of "port" variable)
|
||||||
host: optional host address (falls back to value of "hist" variable)
|
host: optional host address (falls back to value of "host" variable)
|
||||||
|
prefix: optional prefix (falls back to value of "path-prefix" variable)
|
||||||
*/
|
*/
|
||||||
Server.prototype.listen = function(port,host) {
|
Server.prototype.listen = function(port,host,prefix) {
|
||||||
// Handle defaults for port and host
|
// Handle defaults for port and host
|
||||||
port = port || this.get("port");
|
port = port || this.get("port");
|
||||||
host = host || this.get("host");
|
host = host || this.get("host");
|
||||||
|
prefix = prefix || this.get("path-prefix");
|
||||||
// Check for the port being a string and look it up as an environment variable
|
// Check for the port being a string and look it up as an environment variable
|
||||||
if(parseInt(port,10).toString() !== port) {
|
if(parseInt(port,10).toString() !== port) {
|
||||||
port = process.env[port] || 8080;
|
port = process.env[port] || 8080;
|
||||||
}
|
}
|
||||||
$tw.utils.log("Serving on " + this.protocol + "://" + host + ":" + port,"brown/orange");
|
$tw.utils.log("Serving on " + this.protocol + "://" + host + ":" + port + prefix,"brown/orange");
|
||||||
$tw.utils.log("(press ctrl-C to exit)","red");
|
$tw.utils.log("(press ctrl-C to exit)","red");
|
||||||
// Warn if required plugins are missing
|
// Warn if required plugins are missing
|
||||||
if(!$tw.wiki.getTiddler("$:/plugins/tiddlywiki/tiddlyweb") || !$tw.wiki.getTiddler("$:/plugins/tiddlywiki/filesystem")) {
|
if(!$tw.wiki.getTiddler("$:/plugins/tiddlywiki/tiddlyweb") || !$tw.wiki.getTiddler("$:/plugins/tiddlywiki/filesystem")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user