This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 1,000,000+ packages pre-installed, including
koa-views-render with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
npm install @ladjs/koa-views-render
yarn add @ladjs/koa-views-render
This is a simple middleware that simply passes down to
localsarguments you provide.
render(page,locals)will get passed to
ctx.render(page,locals). See koa-views for full reference.
const render = require('koa-views-render'); // ... app.use(render('home'));
app.use(render('about', title: 'About Us' });