Hi Jayfresh

Yes, compatibility with Express-type routes sounds like the right thing to
> aim for. Do you have use cases in mind?
>

I was thinking of existing Express apps that might benefit from dropping in
TW to provide a docs user interface (whether it's single file TW-based or
separate static HTML files). Or to provide a collaboration user interface.

The other side of the coin is to be able to use existing Express-compatible
middleware within TW. For instance, here's an Express module that resizes
images:

https://github.com/thomaspeklak/express-resizer

Best wishes

Jeremy


On Thursday, November 6, 2014 9:36:22 PM UTC, Jeremy Ruston wrote:
>
> Hi Jayfresh
>
> I would definitely like to make the server command extensible so that
> additional routes can be added. I'd also like GETting, PUTting and POSTing
> individual tiddlers to be part of the core.
>
> There are a couple of relevant issues and pull requests:
>
> https://github.com/Jermolene/TiddlyWiki5/pull/976 - pull request from
> @natecain to add configurable GET routes
> https://github.com/Jermolene/TiddlyWiki5/issues/1000 - discusses adding
> content negotiation, which is needed if we want to be able to GET raw
> tiddlers and rendered tiddlers on the same URI
>
> I'm interested in being compatible with express.js, both in the sense of
> being able to plug express-compatible routes into TiddlyWiki as well as
> being able to use TiddlyWiki routes in a larger express application.
>
> Best wishes
>
> Jeremy.
>
>
> On Thu, Nov 6, 2014 at 9:26 PM, jayfresh <[email protected]> wrote:
>
>> I've been doing a little investigation with the aim of adding a new route
>> to the tiddlywiki server, which you get by running the server command under
>> node.js:
>>
>> tiddlywiki myWikiFolder --server
>>
>> I wanted to be able to view my tiddlers as individual HTML, like so:
>>
>> http://localhost:8080/myTiddler
>>
>> Approach one, which I couldn't make work, tried to manipulate the server
>> object that the server command creates at startup. But this didn't work as
>> I don't think the server is exposed.
>>
>> Approach two was to create a new command, "tiddler-server", which
>> inherits from the original server command, but extends it. So the command
>> to run the server becomes:
>>
>> tiddlywiki myWikiFolder --tiddler-server
>>
>> It's not ideal, as it rather removes the possibility of having multiple
>> plugins diving in and adding different routes to the server, but it gets me
>> what I need for now.
>>
>> Here's a gist of a working tiddler-server command:
>> https://gist.github.com/jayfresh/07edb4b270ee50d84e6b
>>
>> I'd be interested to hear if anyone has a similar use case.
>>
>>
>> J.
>>
>> --
>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/tiddlywiki.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Jeremy Ruston
> mailto:[email protected]
>



-- 
Jeremy Ruston
mailto:[email protected]

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to