Skip to content

Commit

Permalink
add SSL option
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Jan 3, 2020
1 parent 9b1a194 commit 3770006
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const optionSpec = {
{ option: 'port', alias: 'p', type: 'Int', description: 'port', default: '8080' },
{ option: 'dirs', type: 'Boolean', description: 'show directory listing', default: 'true', },
{ option: 'cors', type: 'Boolean', description: 'send CORS headers', default: 'true', },
{ option: 'ssl', type: 'Boolean', description: 'use HTTPS', default: 'false', },
{ option: 'local', type: 'Boolean', description: 'local machine only', default: 'false', },
{ option: 'index', type: 'Boolean', description: 'serve index.html for directories', default: 'true', },
],
Expand Down Expand Up @@ -65,6 +66,7 @@ const defaultSettings = {
root: app.getPath("home"),
local: false,
cors: true,
ssl: false,
dirs: true,
index: true,
scan: true,
Expand Down Expand Up @@ -277,6 +279,7 @@ if (isShell) {
settings.local = args.local;
settings.index = args.index;
settings.cors = args.cors;
settings.ssl = args.ssl;
settings.root = args._[0];
}

Expand Down
4 changes: 4 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ <h2>A simple web server for local web development</h2>
<label for="cors">Set CORS headers</label>
<input type="checkbox" id="cors"/>
</div>
<div class="item checkbox">
<label for="ssl">Use HTTPS</label>
<input type="checkbox" id="ssl"/>
</div>
<div class="buttons">
<button id="start">Start</button>
<button id="launch">Launch Browser</button>
Expand Down

0 comments on commit 3770006

Please sign in to comment.