[TW5] [node.js] Could you please post an example of Express.js code using the new Tiddlywiki Pre-Release 5.1.14?

151 views
Skip to first unread message

Julio Cantarero

unread,
Apr 14, 2017, 7:15:15 PM4/14/17
to TiddlyWiki
Dear Jeremy, Arlen,

I would like to launch TiddlyWiki5 in node.js from an Express application, as Arlen demonstrated some time ago in his code: Hosting multiple tiddlywikis on Express.

But I am using tiddlywiki pre-release 5.1.14, which includes an enhancement for this integration. From the release notes: "Refactored server mechanism to make it simpler to integrate TiddlyWiki into ExpressJS apps".

I understand the previous code example is no longer valid after this change, but my knowledge of node.js and express is very basic, and I have not managed to write JS code to successfully require and use the TW server within the Express.js code.

Whenever you have some spare time, could you please post an example of how TW5 should be required, initialized and the requestHandler function passed to Express app.all()?

Thank you,

Julio

Arlen Beiler

unread,
Apr 16, 2017, 7:35:33 AM4/16/17
to TiddlyWiki
The main difference is that you do not have to modify core/commands/server.js. Everything else should be identical. Feel free ask if you have any more trouble.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/9bb56cc8-2ebd-4b22-8b33-fbad93b1a982%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arlen Beiler

unread,
Apr 18, 2017, 9:04:22 AM4/18/17
to TiddlyWiki
I have updated it for 5.1.14. It should work but I did not test it so let me know if you run into any problems.

Julio Cantarero

unread,
May 14, 2017, 3:11:52 PM5/14/17
to TiddlyWiki
Hi Arlen,

I tried again your code in gist and this time it worked perfectly. The TW5 data was served fine from the express application.

This time I installed tiddlywiki using npm locally, rather than using the global installation. I don't know if that also makes any difference in your instructions.
Thank you for updating the gist entry,

Julio



Reply all
Reply to author
Forward
0 new messages