0.0.9 • Published 4 years ago
koa-liquidjs v0.0.9
koa-liquidjs implements a wrapper around the liquidjs package, making it simple to start working with view templates in Koa.
Install via npm:
npm i koa-liquidjs
.
Basic example:
const Koa = require('koa');
const KoaLiquid = require('koa-liquidjs');
const app = new Koa();
const engine = new KoaLiquid('./views/');
app.use(async (ctx, next) => {
ctx.body = await engine.render('test', {
hello_world: 'Hello world!'
});
});
app.on('error', (error) => {
console.error(error);
});
app.listen(3000);
For options see liquidjs options.