Hi Javid Firstly, I strongly advise that the best way to add authentication to TW5 is via a proxy that couples at the HTTP level, rather than the sort of JavaScript integration that you're looking at here.
Anyhow, the most flexible way to use off-the-shelf library modules within TiddlyWiki5 is to wrap the module up into a plugin. You can see several examples of this within the plugins folder of the TW5 repo - https://github.com/Jermolene/TiddlyWiki5/tree/master/plugins/tiddlywiki * codemirror and d3 both wrap browser libraries that don't run on the server * jasmine wraps the Jasmine testing library which runs under node and the browser The basic technique is to use a `tiddlywiki.files` file like this one: https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/jasmine/jasmine-1.3.1/tiddlywiki.files Search five.tiddlywiki.com for TiddlyWikiFolders to learn more about the file format. It's much easier to help if I can see what you've done. If you know GitHub, the easiest way is for you to fork the tw5 repo, and then make changes to your local fork. It's easy to then review the changes, and to pull in subsequent changes from the tw5 repo. Best wishes Jeremy On Fri, Sep 13, 2013 at 11:04 PM, Javid Lakha <[email protected]> wrote: > Dear David, > > I can require modules without causing an error in the console, but I still > get errors in the wiki ('Well, this is embarrassing... '). This is to do > with the wrapper which is required around each module: > > /*\ > title: $:/core/modules/commands/server.js > type: application/javascript > module-type: command > > Serve tiddlers over http > > \*/ > (function(){ > > /*jslint node: true, browser: true */ > /*global $tw: false */ > "use strict"; > > ... > > })(); > > I can write simple modules myself now, which don't crash, but I'm still > having problems using express, passport-local. > > However, I have reached a milestone in that I can restrict access to > certain IP addresses; these need to be hardcoded into a module I made. > > I'm hoping that @Jeremy or somebody more proficient will be able to help > me get express, passport, passport-local, &c. to work. > > Best wishes, > > Javid > > > On Friday, 13 September 2013 22:17:57 UTC+1, David Johnston wrote: >> >> Excellent Javid, >> >> I look forward to seeing it ... it would be handy to authenticate and run >> Node on my production server :) >> >> Thanks >> >> David >> >> >> On Friday, 13 September 2013 21:32:41 UTC+1, Javid Lakha wrote: >>> >>> I think I've sorted this. When I'm confident in it - and get my >>> passport-local authentication module working - I'll try to explain it, for >>> the benefit of others who may have the same question... >>> >>> On Thursday, 12 September 2013 13:46:20 UTC+1, Javid Lakha wrote: >>>> >>>> Hi, >>>> >>>> I need to use a couple of node.js modules that are called in my >>>> modified $:/core/modules/commands/**server.js file. Where do I install >>>> them? Installing them in $:/core/modules/commands/ or in $:/ doesn't seem >>>> to work... >>>> >>>> Thanks! >>>> >>>> Javid >>>> >>> -- > You received this message because you are subscribed to the Google Groups > "TiddlyWikiDev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/tiddlywikidev. > For more options, visit https://groups.google.com/groups/opt_out. > -- Jeremy Ruston mailto:[email protected] -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/tiddlywikidev. For more options, visit https://groups.google.com/groups/opt_out.
