Skip to content

Instantly share code, notes, and snippets.

@connanp
connanp / actions-static.js
Last active December 20, 2015 17:38
This snippet is for rendering Jade templates on the server for pushState single page apps in actionHero. Useful when you need to bootstrap model data on initial page load. It also pre-compiles the templates on server start and will recompile if they change.
var path = require('path')
, _ = require('lodash')
, Streamifier = require('streamifier');
exports.action = {
name: 'index',
description: 'server-side rendered index',
outputExample: {},
inputs: { required: [], optional: [] },
run: function(api, connection, next){