0.1.2 • Published 9 years ago

n0gx v0.1.2

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

n0gx

No Nginx, Node Only

Features

  • Static
  • Proxy
  • Redirect
  • Concat
  • Sendfile
  • Status Only
  • 404/4xx/5xx
  • Slash Safe
  • Hostnames

Todo

  • Test
  • Log
  • More from nginx...

Usage

Boot from any conf file under shell:

$ npm i -g n0gx  ## install
$ n0gx n0gx-conf 8111  ## json/js file, port
// example/n0gx-conf.js
module.exports = {
  'localhost': {
    '/wxtopic/': ['proxy', 'http://localhost:9113'],
    '/blog/': ['proxy', 'http://localhost:8080/blog'],
    '/blog_online/': ['concat', 'http://fritx.me/blog'],
    '/': ['static', './example/static']
  },

  '*': ['sendfile', './example/static/404.html'],
  '4xx': ['status', 400],
  '5xx': ['status', 500]
}
// or as a node module
var n0gx = require('n0gx')
var app = n0gx(conf)
app.listen(8111, function(e){/**/})
0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago