n0gx

0.1.2 • Public • Published

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){/**/})

Readme

Keywords

none

Package Sidebar

Install

npm i n0gx

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • fritx