steal-server-side-render
Server-side rendering for users of StealJS and CanJS.
Usage
var render = config: __dirname + "/public/package.json!npm" main: "index.stache!"; ;
API
asset-register
A module used to register assets:
var register = ; ;
register(moduleName, type, assetMaker)
Register takes the moduleName to register, a type associated with it, and a function that when called returns an HTMLElement.
register(type, assetMaker)
If registering an asset not associated with a particular module, supply only the type and a function that when called returns an HTMLElement.
asset (helper)
When rendering in Node, a special asset
helper is included. This is used to append assets within your template:
{{asset "css"}} ...
In this example, all CSS (either <style>
or <link>
elements depending on whether you are in development or production.
{{asset type}}
Specify the type
to insert. Assets can be registered with asset-register
(docs above). Types provided natively by JavaScriptMVC:
- css: Inserts a
<style>
or<link>
- inline-cache: If using the can.AppMap will insert data fetched as part of the page lifecycle.
License
MIT