Skip to content

Commit

Permalink
Merge pull request #146 from DannyBen/fix/port-bind-config
Browse files Browse the repository at this point in the history
Fix config.port and config.bind
  • Loading branch information
DannyBen authored Mar 9, 2023
2 parents 037e576 + ed5e02e commit 7a7d7a5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
8 changes: 4 additions & 4 deletions lib/madness/commands/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ class Server < Base
usage 'madness server [PATH] [options]'
usage 'madness init (-h|--help)'

param 'PATH', 'Path to the markdown directory [default: .]'
param 'PATH', 'Path to the markdown directory (default: .)'

option '-p --port NUMBER', 'Set server port number [default: 3000]'
option '-b --bind ADDRESS', 'Set server listen address [default: 0.0.0.0]'
option '-p --port NUMBER', 'Set server port number (default: 3000)'
option '-b --bind ADDRESS', 'Set server listen address (default: 0.0.0.0)'
option '-o --open', 'Open a web browser after launching'
option '--auth USER:PASS', 'Enable basic authentication'
option '--auth-zone NAME', 'The basic authentication prompt title [default: Restricted Documentation]'
option '--auth-zone NAME', 'The basic authentication realm (default: Restricted Documentation)'
option '--theme FOLDER', 'Use a custom theme (either absolute or relative to the main documentation path)'

example 'madness server'
Expand Down
2 changes: 1 addition & 1 deletion spec/approvals/cli/config/show-non-default
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
copy_code: true
shortlinks: ~
toc: Table of Contents
theme: ~
theme: my_theme
open: ~
auth: ~
auth_zone: Restricted Documentation
Expand Down
8 changes: 4 additions & 4 deletions spec/approvals/cli/server/help
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Usage:

Options:
-p --port NUMBER
Set server port number [default: 3000]
Set server port number (default: 3000)

-b --bind ADDRESS
Set server listen address [default: 0.0.0.0]
Set server listen address (default: 0.0.0.0)

-o --open
Open a web browser after launching
Expand All @@ -18,7 +18,7 @@ Options:
Enable basic authentication

--auth-zone NAME
The basic authentication prompt title [default: Restricted Documentation]
The basic authentication realm (default: Restricted Documentation)

--theme FOLDER
Use a custom theme (either absolute or relative to the main documentation
Expand All @@ -29,7 +29,7 @@ Options:

Parameters:
PATH
Path to the markdown directory [default: .]
Path to the markdown directory (default: .)

Examples:
madness server
Expand Down
3 changes: 2 additions & 1 deletion spec/approvals/cli/server/run-with-config
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
▌ generating Table of Contents
▌ starting server
▌ env : production
▌ listen : 0.0.0.0:3000
▌ listen : 4.3.2.1:1337
▌ path : ...docs
▌ config : .madness.yml
▌ theme : my_theme

9 changes: 5 additions & 4 deletions spec/fixtures/docroot-with-config/.madness.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# .madness.yml
path: 'docs'
port: '1337'
bind: '4.3.2.1'
path: docs
port: 1337
bind: 4.3.2.1
toc: Table of Contents
invalid_key: with some value
invalid_key: with some value
theme: my_theme

0 comments on commit 7a7d7a5

Please sign in to comment.