All Projects → aui → koa-art-template

aui / koa-art-template

Licence: MIT license
a koa view render middleware, support all feature of art-template

Programming Languages

javascript
184084 projects - #8 most used programming language
Makefile
30231 projects

koa-art-template

NPM Version Node.js Version

Koa art-template view render middleware. support all feature of art-template.

Install

npm install --save art-template
npm install --save koa-art-template

Usage

Example

const Koa = require('koa');
const render = require('koa-art-template');

const app = new Koa();
render(app, {
  root: path.join(__dirname, 'view'),
  extname: '.art',
  debug: process.env.NODE_ENV !== 'production'
});

app.use(async function (ctx) {
  await ctx.render('user');
});

app.listen(8080);

Or you can checkout the example.

Options

Supports art-template options.

State

Support ctx.state in koa.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].