0.0.4 • Published 8 years ago

nginx-server v0.0.4

Weekly downloads
12
License
MIT
Repository
github
Last release
8 years ago

nginx-server

Utility for starting and stopping an Nginx server. Useful when testing an nginx configuration, having a start and stop for every test.

Example

var nginx = require('nginx-server');

var options = {
    config: __dirname + '/test/stubs/nginx.conf',
};

var server = nginx(options);

server.start(function () {
    console.log('started');
});

server.stop(function () {
    console.log('stopped');
});

Options

config: string Path to configuration file.
prefix: string Set nginx path prefix, i.e. a directory that will keep server files.
globals: [string] String array of global configuration directives.
command: string Nginx executable (default: 'nginx').
log: function Pass in function for logging nginx output.

Development

Run tests

docker build -f docker/Dockerfile.test -t test-nginx-server .
docker run --rm -v $(pwd):/usr/src/app -it test-nginx-server
0.0.4

8 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago

0.0.1-alpha

9 years ago