Eleventy: Add host option to --serve

Created on 12 Mar 2019  ·  3Comments  ·  Source: 11ty/eleventy

Given Eleventy is launched through a Docker instance 
When I run eleventy --serve --host 0.0.0.0
Then UI is served http://0.0.0.0:8080
$ eleventy serve --help
--serve
       Run web server on --port (default 8080) and watch them too
--host
        Host to bind to (default localhost)

Most helpful comment

This is exposed in the config API but not as a CMD line param: https://browsersync.io/docs/options#option-host

https://www.11ty.io/docs/config/#override-browsersync-server-options

All 3 comments

This would be useful for several use cases. Just thinking that there should be a disclaimer to note that the serve mode is only meant for development, not for production usage (as someone will likely end up using it for that too…).

This is exposed in the config API but not as a CMD line param: https://browsersync.io/docs/options#option-host

https://www.11ty.io/docs/config/#override-browsersync-server-options

@zachleat Thanks for pointing in the right direction. 🙏

Ideally I wish I could pass many configuration files to be able to only add this to a specific environment without having to copy my default config. But maybe is there another way to achieve this:

ELEVENTY_ENV=staging eleventy --serve --config=.eleventy.js,.eleventy.staging.js

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michrome picture michrome  ·  3Comments

matt-auckland picture matt-auckland  ·  3Comments

kaloja picture kaloja  ·  3Comments

robdodson picture robdodson  ·  3Comments

zellwk picture zellwk  ·  3Comments