Skip to content

Commit 5c3498c

Browse files
committed
Change default host in the docs
1 parent e14fde3 commit 5c3498c

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

packages/create-razzle-app/templates/default/README.md

+23-14
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,28 @@ If your application is running, and you need to manually restart your server, yo
8181

8282
**Table of Contents**
8383

84-
* [Customization](#customization)
85-
* [Extending Babel Config](#extending-babel-config)
86-
* [Extending Webpack](#extending-webpack)
87-
* [Environment Variables](#environment-variables)
88-
* [Adding Temporary Environment Variables In Your Shell](#adding-temporary-environment-variables-in-your-shell)
89-
* [Windows (cmd.exe)](#windows-cmdexe)
90-
* [Linux, macOS (Bash)](#linux-macos-bash)
91-
* [Adding Environment Variables In `.env`](#adding-environment-variables-in-env)
92-
* [What other `.env` files are can be used?](#what-other-env-files-are-can-be-used)
93-
* [How Razzle works (the secret sauce)](#how-razzle-works-the-secret-sauce)
94-
* [Inspiration](#inspiration)
95-
* [Author](#author)
96-
* [Contributors](#contributors)
84+
- [Quick Start](#quick-start)
85+
- [`npm start` or `yarn start`](#npm-start-or-yarn-start)
86+
- [`npm run build` or `yarn build`](#npm-run-build-or-yarn-build)
87+
- [`npm run start:prod` or `yarn start:prod`](#npm-run-startprod-or-yarn-startprod)
88+
- [`npm test` or `yarn test`](#npm-test-or-yarn-test)
89+
- [`npm start -- --inspect` or `yarn start -- --inspect`](#npm-start------inspect-or-yarn-start------inspect)
90+
- [`npm start -- --inspect-brk` or `yarn start -- --inspect-brk`](#npm-start------inspect-brk-or-yarn-start------inspect-brk)
91+
- [`rs`](#rs)
92+
- [<img src="https://user-images.githubusercontent.com/4060187/37915268-209644d0-30e7-11e8-8ef7-086b529ede8c.png" width="500px" alt="Razzle Hot Restart"/>](#)
93+
- [Customization](#customization)
94+
- [Customizing Babel Config](#customizing-babel-config)
95+
- [Extending Webpack](#extending-webpack)
96+
- [Environment Variables](#environment-variables)
97+
- [Adding Temporary Environment Variables In Your Shell](#adding-temporary-environment-variables-in-your-shell)
98+
- [Windows (cmd.exe)](#windows-cmdexe)
99+
- [Linux, macOS (Bash)](#linux-macos-bash)
100+
- [Adding Environment Variables In `.env`](#adding-environment-variables-in-env)
101+
- [What other `.env` files are can be used?](#what-other-env-files-are-can-be-used)
102+
- [How Razzle works (the secret sauce)](#how-razzle-works-the-secret-sauce)
103+
- [Inspiration](#inspiration)
104+
- [Author](#author)
105+
- [Contributors](#contributors)
97106

98107
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
99108

@@ -155,7 +164,7 @@ Last but not least, if you find yourself needing a more customized setup, Razzle
155164
* `process.env.REACT_BUNDLE_PATH`: Relative path to where React will be bundled during development. Unless you are modifying the output path of your webpack config, you can safely ignore this. This path is used by `react-error-overlay` and webpack to power up the fancy runtime error iframe. For example, if you are using common chunks and an extra entry to create a vendor bundle with stuff like react, react-dom, react-router, etc. called `vendor.js`, and you've changed webpack's output to `[name].js` in development, you'd want to set this environment variable to `/static/js/vendor.js`. If you do not make this change, nothing bad will happen, you will simply not get the cool error overlay when there are runtime errors. You'll just see them in the console. Note: This does not impact production bundling.
156165
* `process.env.VERBOSE`: default is false, setting this to true will not clear the console when you make edits in development (useful for debugging).
157166
* `process.env.PORT`: The `BUILD_TARGET=server` build listens on this port for all NODE_ENVs. default is `3000`
158-
* `process.env.HOST`: The IP address that the server will bind to. default is `0.0.0.0`, for INADDR_ANY
167+
* `process.env.HOST`: The IP address that the server will bind to. default is `localhost`, for INADDR_ANY
159168
* `process.env.NODE_ENV`: `'development'` or `'production'`
160169
* `process.env.BUILD_TARGET`: either `'client'` or `'server'`
161170
* `process.env.PUBLIC_PATH`: Only in used in `razzle build`. You can alter the `webpack.config.output.publicPath` of the client assets (bundle, css, and images). This is useful if you plan to serve your assets from a CDN. Make sure to _include_ a trailing slash (e.g. `PUBLIC_PATH=https://cdn.example.com/`). If you are using React and altering the public path, make sure to also [include the `crossorigin` attribute](https://reactjs.org/docs/installation.html#using-a-cdn) on your `<script>` tag in `src/server.js`.

packages/razzle/config/env.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function getClientEnvironment(target, is_dev, options, paths) {
5151
NODE_ENV: process.env.NODE_ENV || 'development',
5252
PORT: process.env.PORT || options.port || 3000,
5353
VERBOSE: !!process.env.VERBOSE,
54-
HOST: process.env.HOST || options.host || '0.0.0.0',
54+
HOST: process.env.HOST || options.host || 'localhost',
5555
RAZZLE_ASSETS_MANIFEST: paths.appAssetsManifest,
5656
BUILD_TARGET: target === 'web' ? 'client' : 'server',
5757
// only for production builds. Useful if you need to serve from a CDN

website/pages/docs/environment-variables.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- `process.env.REACT_BUNDLE_PATH`: Relative path to where React will be bundled during development. Unless you are modifying the output path of your webpack config, you can safely ignore this. This path is used by `react-error-overlay` and webpack to power up the fancy runtime error iframe. For example, if you are using common chunks and an extra entry to create a vendor bundle with stuff like react, react-dom, react-router, etc. called `vendor.js`, and you've changed webpack's output to `[name].js` in development, you'd want to set this environment variable to `/static/js/vendor.js`. If you do not make this change, nothing bad will happen, you will simply not get the cool error overlay when there are runtime errors. You'll just see them in the console. Note: This does not impact production bundling.
1010
- `process.env.VERBOSE`: default is false, setting this to true will not clear the console when you make edits in development (useful for debugging).
1111
- `process.env.PORT`: The `BUILD_TARGET=server` build listens on this port for all NODE_ENVs. default is `3000`
12-
- `process.env.HOST`: The IP address that the server will bind to. default is `0.0.0.0`, for INADDR_ANY
12+
- `process.env.HOST`: The IP address that the server will bind to. default is `localhost`, for INADDR_ANY
1313
- `process.env.NODE_ENV`: `'development'` or `'production'`
1414
- `process.env.BUILD_TYPE`: `'iso'` for isomorphic/universal applications or `'spa'` for single page applications. The default is `'iso'`. This is set by CLI arguments.
1515
- `process.env.BUILD_TARGET`: either `'client'` or `'server'`

0 commit comments

Comments
 (0)