node-sitefile
Version:
Bootstrap Express webserver for misc. resources using Sitefile
76 lines (40 loc) • 2.67 kB
Markdown
Examples
========
- [ Server generated page ](./server-generated-page) - [(pug)](./server-generated-page.pug)
- [ Server generated stylesheet ](./server-generated-stylesheet) - [(stylus)](./server-generated-stylesheet.styl)
- [ Server generated script ](./server-generated-javascript) - [(coffee-script)](./server-generated-javascript.coffee)
Also see browser JavaScript console for proof of concept.
Extensions are mapped to one handler, no content negotiation.
Also paths with extensions may be forcefully redirected to the published
variants.
The current implementation maps a path extension to an Express handler. There is
little in the sense of true resources yet, the content is served with the local
path without extension as the URL. No negotiation, and most routers are rather
primitive and don't do much with headers or a lot of input sanitizing and error
handling.
- [ This is a markdown file ](./main.md)
- [ The ReadMe ](/ReadMe.rst) is formatted in Docutils reStructuredText
- The [media/](/media/), [public/components/](/components/) and [example/](/example/) directories are served directly from filesystem paths using the static router. The static router does not create indices, but redirects to the 'index' or 'main' files if present.
- [ Sh ](./sh-script) - [(script)](./sh-script.sh)
# Paremeterization
Routers can inspect the entire application context.
The resource context is initialized with a 'route.options' attribute to hold any
custom data. The data is loaded from the Sitefile if given.
Router modules have an defaults attribute, this can also provide
default 'route.options'.
[Query to handler options](/Sitefile/debug?pretty=true&bar[baz]=foo)
# Graphviz
From [ Graphviz dotguide ](http://www.graphviz.org/pdf/dotguide.pdf)











***
- [ Back to ReadMe ](/ReadMe)