Skip to content

About

PostHTML for Koa

Resources

Contributing

Stars

7 stars

Watchers

2 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

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 Deps Tests Coverage Standard Code Style Chat

Koa PostHTML

Install

npm i -S koa-posthtml

Usage

'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'))

Maintainers


Michael Ciniawsky

Contributing

See PostHTML Guidelines and contribution guide.

LICENSE

About

PostHTML for Koa

Resources

Contributing

Stars

7 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages