When issue the command gitbook serve, server will listen at tcp port 4000. How to customize the port ? Case is that: when to two books at same time, a collision happens.
2 Answers
lrport defaul to 35729, port default to 4000.
So you can change both two ports and serve as many books as you want.
eg:
one:
gitbook --lrport 35730 --port 4001 serve
another:
gitbook --lrport 35731 --port 4002 serve
Note
# gitbook help
...
serve [book] [output] serve the book as a website for testing
--port Port for server to listen on (Default is 4000)
--lrport Port for livereload server to listen on (Default is 35729)
--[no-]watch Enable file watcher and live reloading (Default is true)
--[no-]live Enable live reloading (Default is true)
--[no-]open Enable opening book in browser (Default is false)
--browser Specify browser for opening book (Default is )
--log Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)
--format Format to build to (Default is website; Values are website, json, ebook)
...
Specify port number flag. Ex: use port number 3000
gitbook --port 3000 serve