npm.io
0.0.3 • Published 9 years ago

riot-ssr-middleware

Licence
ISC
Version
0.0.3
Deps
1
Vulns
0
Weekly
0
Stars
1

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: { ... }
})))

Keywords