Warning
This package is no longer maintained. It will not receive updates, fixes or support. PostHTML itself can be used directly: https://github.com/posthtml/posthtml
npm i -S koa-posthtml'use strict'
import { join } from 'path'
import koa from 'koa'
import posthtml from 'koa-posthtml'
const app = koa()
// Setup View Engine
posthtml(app, {
ext: 'html',
root: join(__dirname, 'views'),
options: {/* Options */},
plugins: [/* Plugins */]
writeResp: true
})
app.use(function * () {
// Render index.html
yield this.render('index')
})
app.on('error', (err) => console.error('=> Server error', err))
app.listen(3000, () => console.log('=> Server started'))|
Michael Ciniawsky |
See PostHTML Guidelines and contribution guide.