Replies: 1 comment 5 replies
-
Maybe you can use a script to run wiki: import path from 'path';
import tiddlywiki from 'tiddlywiki';
function startNodeJSWiki({ homePath, tiddlyWikiPort = Math.floor(Math.random() * 13000) - 3000, userName }) {
return new Promise((resolve, reject) => {
const wikiInstance = tiddlywiki.TiddlyWiki();
try {
process.env.TIDDLYWIKI_PLUGIN_PATH = path.resolve(homePath, 'plugins');
process.env.TIDDLYWIKI_THEME_PATH = path.resolve(homePath, 'themes');
// add tiddly filesystem back https://github.com/Jermolene/TiddlyWiki5/issues/4484#issuecomment-596779416
wikiInstance.boot.argv = [
'+plugins/tiddlywiki/filesystem',
'+plugins/tiddlywiki/tiddlyweb',
homePath,
'--listen',
`anon-username=${userName}`,
`port=${tiddlyWikiPort}`,
`host=${defaultServerIP}`,
'root-tiddler=$:/core/save/lazy-images',
];
wikiInstance.boot.startup({
callback: () => resolve(`Tiddlywiki booted at http://localhost:${tiddlyWikiPort}`),
});
} catch (error) {
const message = `Tiddlywiki booted failed with error ${error.message} ${error.stack ?? ''}`;
reject(message);
}
});
} And maybe check for port usage before use it, and reroll if used. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have frequently start different Tiddlywiki by visiting the folder and issue the below command
or simply
Sometime I forget which ports are available and I get error!!
I am wondering if we could have an option to start Tiddlywiki on a random port or next vacant port like
or
Beta Was this translation helpful? Give feedback.
All reactions