From b1b893c6924849ec36b9a7e474aabd6be5a2d877 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 7 Mar 2012 17:40:37 +0000 Subject: [PATCH] Fix and a script for serving wikis over http Makes it easier to test on the iPad --- tiddlywiki.js | 5 +---- tw5s.sh | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100755 tw5s.sh diff --git a/tiddlywiki.js b/tiddlywiki.js index 3fc0c21cd2..1e7302e0a9 100644 --- a/tiddlywiki.js +++ b/tiddlywiki.js @@ -167,10 +167,7 @@ var commandLineSwitches = { // Dumbly, this implementation wastes the recipe processing that happened on the --recipe switch http.createServer(function(request, response) { response.writeHead(200, {"Content-Type": "text/html"}); - var store = new WikiStore(); - var recipe = new Recipe({store: store,filepath: lastRecipeFilepath},function() { - response.end(recipe.cook(), "utf8"); - }); + response.end(recipe.cook(), "utf8"); }).listen(port); } }, diff --git a/tw5s.sh b/tw5s.sh new file mode 100755 index 0000000000..b4ec28e37e --- /dev/null +++ b/tw5s.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# serve TiddlyWiki5 over HTTP + +# cook TiddlyWiki5 +node tiddlywiki.js --recipe $PWD/tiddlywiki5/tiddlywiki5.recipe --servewiki 8080 || exit 1