Skip to content

node200ok/n0gx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No Nginx, Node Only

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.3%
  • HTML 0.7%