mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-06 11:32:27 +00:00

* Refactor server routes to modules New module type: serverroute Caveats: Loading order is not deterministic but this would only matter if two route modules attempted to use the same path regexp (that would be silly). * Add static assets plugin This plugin allows the node server to fetch static assets in the /assets directory. I felt that this was a feature that goes above the core functionality. That is why I added it as a plugin. with the modular route extensions this was a breeze. * Add serverroute description to ModuleTypes
19 lines
620 B
Plaintext
19 lines
620 B
Plaintext
title: $:/plugins/tiddlywiki/server-static-assets/readme
|
|
|
|
This plugin allows the Node.JS server to serve static files from the filesystem.
|
|
|
|
Any files that are placed in `assets` can be served to the browser directly.
|
|
|
|
For example, if you had a wiki editions with the following directory structure:
|
|
|
|
```
|
|
editions/tw5.com-server
|
|
├── assets
|
|
│ └── pony.png
|
|
├── tiddlers
|
|
│ └── (All the tiddler files)
|
|
└── tiddlywiki.info
|
|
```
|
|
|
|
And the command `tiddlywiki editions/tw5.com-server --server` then pointing your browser to `http://localhost:8080/assets/pony.png` would display the image.
|