Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route to static files in the --server mode #1148

Closed
peko opened this issue Nov 27, 2014 · 10 comments
Closed

Route to static files in the --server mode #1148

peko opened this issue Nov 27, 2014 · 10 comments

Comments

@peko
Copy link

peko commented Nov 27, 2014

Most of my notes needs an attachment feature (mostly huge pdfs). I found no good way for this.

So I'm just added an new static route for "files" subfolder.

It is ok to do it like this, or there is a better way / or plugin?

@peko peko changed the title Route to static files in --server mode Route to static files in the --server mode Nov 27, 2014
@Jermolene
Copy link
Owner

Hi @peko that looks like a reasonable approach - at the moment plugins can't add new routes to the server module. We're planning some enhancements to the server module - see #512, #970, #976, #978, #1000.

@tobibeer
Copy link
Contributor

What exactly is this doing? Is it making the node.js server not include tiddlers from ./files/ but serve them individually? => Any pointers on where to read up on that?

@peko
Copy link
Author

peko commented Nov 27, 2014

Hi, @tobibeer, it allows me to create working links like this: [ext[files/big_file.pdf]] to tiddlers subfolder tiddlers/files/*.
Probably it is bad idea putting attachments there, will it interfere with tid parser?
Need I move it to root folder?

@Jermolene
Copy link
Owner

Hi @peko everything in the tiddlers folder will be processed as a tiddler in the wiki, so, yes, you should store your files elsewhere; perhaps a files folder in the root of the wiki folder.

@tobibeer
Copy link
Contributor

it allows me to create working links like this: [ext[files/big_file.pdf]] to tiddlers subfolder tiddlers/files/*.

so, (excuse my code-illiteracy,) is TiddlyWiki "route-aware" ...in its node.js server edition?

@Jermolene
Copy link
Owner

Yes, the server module works by defining routes and handlers, but the routes are not currently extensible.

@sukima
Copy link
Contributor

sukima commented Jul 19, 2016

@Jermolene:

but the routes are not currently extensible.

They are now in PR #2502 😁

This PR also addresses @peko's issue. It adds a static assets route as a plugin. Hope this helps. 😉

@pmario
Copy link
Contributor

pmario commented May 17, 2017

@peko .. imo can be closed see #2502

@pmario
Copy link
Contributor

pmario commented May 28, 2018

@Jermolene ... IMO can be closed. It seems to be done in #2510

@Jermolene
Copy link
Owner

Thanks @pmario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants