koa-views-render
v0.0.1
Published
Simple render(page, locals) middleware for Koa and Lad (uses koa-views)
Downloads
266
Readme
koa-views-render
Simple
render(page, locals)
middleware for Koa and Lad (uses koa-views).
Table of Contents
Install
npm:
npm install @ladjs/koa-views-render
yarn:
yarn add @ladjs/koa-views-render
Usage
This is a simple middleware that simply passes down to
ctx.render
thepage
andlocals
arguments you provide.For example
render(page,locals)
will get passed toctx.render(page,locals)
. See koa-views for full reference.
const render = require('koa-views-render');
// ...
app.use(render('home'));
With optional
locals
object argument:
app.use(render('about', title: 'About Us' });
Contributors
| Name | Website | | -------------- | -------------------------- | | Nick Baugh | http://niftylettuce.com/ |