Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Server.prototype.start = function(prefix) {
var socketPath = path.join(this.socketDir, prefix);
var wikiPath = path.join(this.wikiDir, prefix);
console.log("Starting server at " + prefix + " for " + wikiPath);
// Create the server on a unix socket path
var $tw = require("tiddlywiki/boot/bootprefix.js").bootprefix();
delete $tw.browser;
var server = require("tiddlywiki/boot/boot.js").TiddlyWiki($tw);
server.boot.argv = [wikiPath, '--unixserver', socketPath]
server.boot.boot();
// Save the server to the object, so we can shut it down later if needed.
this.servers[prefix] = server;
// Setup the proxy rules to route to the correct location.
this.proxyRules.rules["/" + prefix] = {socketPath: socketPath};
};