0.0.3 • Published 8 years ago

riot-ssr-middleware v0.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

riot-ssr-middleware

riot-ssr wrapped into an Express-compatible middleware for convenience.

Installation

npm i -S riot-ssr-middleware

Usage

const riotRenderMiddleware = require('riot-ssr-middleware')

router.use(riotRenderMiddleware({
  path: '/path/to.tag',
  opts: { ... }
}))

or pass it properties from req or res:

router.use(riotRenderMiddleware((req, res) => ({
  path: req.pathToTag,
  opts: { ... }
})))