Skip to content

Commit

Permalink
feat( host ): add listen host passed as option
Browse files Browse the repository at this point in the history
  • Loading branch information
elmariofredo committed Oct 18, 2015
1 parent 3717ac9 commit 0b6ff2e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions bin/webpack-super-dev-server
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

const Server = require( '../' );

const exampleText = 'webpack-super-dev-server -p 9000 --proxy http://localhost:3000 --proxyPath /api --mockConfig mockConfig1.json --mockConfig mockConfig2.json';
const exampleWillDoText = 'Will start server on port 3000 and will proxy /api requests to http://localhost:3000 and repond with mockConfig1.json and mockConfig2.json mocks';
const exampleText = 'webpack-super-dev-server -p 9000 -h 0.0.0.0 --proxy http://localhost:3000 --proxyPath /api --mockConfig mockConfig1.json --mockConfig mockConfig2.json';
const exampleWillDoText = 'Will start server on 0.0.0.0:3000 and will proxy /api requests to http://localhost:3000 and repond with mockConfig1.json and mockConfig2.json mocks';

const argv = require( 'yargs' )
.usage( 'Usage: $0 [options]' )
Expand All @@ -18,6 +18,12 @@ const argv = require( 'yargs' )
default: 'app',
type: 'string'
})
.option( 'host', {
alias: 'h',
describe: 'Dev server host ip',
default: 'localhost',
type: 'string'
})
.option( 'port', {
alias: 'p',
describe: 'Dev server port',
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function SuperServer( options ) {

}

server.listen( options.port, 'localhost' );
server.listen( options.port, options.host );


/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webpack-super-dev-server",
"version": "1.0.0",
"version": "1.1.0",
"description": "Webpack server with Mock and Proxy support",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 0b6ff2e

Please sign in to comment.