0.8.1 • Published 9 years ago

hexi v0.8.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

hexi

A hapi skin for express

Dependency Status Build Status npm version Coverage Status

Motivation

hapi is a great web framework that allows to write well structured servers. However, it has far less plugins and extensions than express (Node.js Framework Comparison: Express vs. Koa vs. Hapi). Hexi allows to write a web framework that has the well structured skeleton of a hapi server but uses express under the hood. As a consequence, a hexi app has the great structure of a hapi server and the wide variety of express middlewares available on npm.

Installation

npm install --save hexi

Basic Usage

// server.js
'use strict'
const express = require('express')
const hexi = require('hexi')

const app = express()
const server = hexi(app)

server.register([
  {
    register: require('hexi-default'),
  },
  {
    register: require('./hello-world-controller'),
  }
])
.then(() => {
  app.listen(8000)
})

// hello-world-controller.js
'use strict'
module.exports = (server, opts) => {
  server.route({
    method: 'GET',
    path: '/',
    handler (req, res) {
      res.send('Hello world!')
    },
  })
}

For samples of advanced usage see the hexi version of the hackathon starter.

License

MIT © Zoltan Kochan

0.8.1

9 years ago

0.8.0

9 years ago

0.7.2

9 years ago

0.7.1

9 years ago

0.7.0

9 years ago

0.6.1

9 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.2

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.0

10 years ago