项目作者: nuintun

项目描述 :
A static node http/https server
高级语言: JavaScript
项目地址: git://github.com/nuintun/nengine.git
创建时间: 2014-11-21T17:12:40Z
项目社区:https://github.com/nuintun/nengine

开源协议:MIT License

下载


nengine

A static node http/https server

NPM Version
Download Status
Node Version
Dependencies

Getting started

Install

  1. $ npm install nengine

Note: nengine require nengine-cli

Introduction

if you have installed nengine-cli and nengine, you can run nengine by command:

  1. $ nengine

and use:

  1. $ nengine -h

for help.

you can config server by nengine.yml under server root:

  1. port: # default: 80
  2. 80
  3. hostname: # default: 127.0.0.1
  4. 127.0.0.1
  5. dir: # default: deny
  6. allow
  7. key: # options if not https server
  8. /key.pem
  9. cert: # options if not https server
  10. /cert.pem
  11. ignoreAccess: # default: deny
  12. deny
  13. ignore: # default: []
  14. - /nengine.yml
  15. - /node_modules(|/**)
  16. maxAge: # default: 0
  17. 2592000
  18. index: # default: []
  19. - index.htm
  20. - index.html
  21. - default.htm
  22. - default.html
  23. etag: # default: true
  24. true
  25. lastModified: # default: true
  26. true
  27. error: # default: {}
  28. 404:
  29. /error/404.html
  30. default:
  31. /error/default.html

port: server port. {Number}

hostname: server hostname. {String}

key: https key path relative to root. {String}

cert: https cert path relative to root. {String}

dir: show directory, you can set “allow”, “deny”, “ignore”. {String}

ignoreAccess: set how “ignore” are treated when encountered. {String}

the default value is 'deny'.

  • 'deny' send a 403 for any request for ignore matched.
  • 'ignore' pretend like the ignore matched does not exist and 404.

ignore: set dir and files ignore glob rules. {Array|String}

maxAge: set max-age, unit: seconds and also you can set like “2 days”. {Number|String}

index: set default document. {Array|String}

etag: set etag. {Boolean}

lastModified: set lastModified. {Boolean}

error: set custom error page. {Object}

License

MIT