0.0.1 • Published 5 years ago

@zcorky/koa-ejs v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

koa-ejs

NPM version Coverage Status Dependencies Build Status license issues

ejs for Koa, wrapper with ejs.

Install

$ npm install @zcorky/koa-ejs

Usage

// See more in test
import * as path from 'path';
import ejs from '@zcorky/koa-ejs';

import * as Koa from 'koa';
const app = new Koa();

app.use(ejs({
  dir: path.join(__dirname, './view'),
}));

app.use(ctx => {
  ctx.render('index');
});

app.listen(8000, '0.0.0.0', () => {
  console.log('koa server start at port: 8000');
});

Related