Skip to content

Instantly share code, notes, and snippets.

@jhhb
Last active July 12, 2020 15:28
Show Gist options
  • Save jhhb/411f22df91149b4729dab5a44fa6039c to your computer and use it in GitHub Desktop.
Save jhhb/411f22df91149b4729dab5a44fa6039c to your computer and use it in GitHub Desktop.
.ember-cli with live reload example

If you:

  1. Run a separate ember + backend server, and
  2. want to enable browser auto-refresh using .ember-cli, use the following config:
{
  "disableAnalytics": true, // not necessary
  "usePods": true, // project-dependent
  "checkForUpdates": true,
  "port" : 4200,
  "proxy": "http://localhost:3000/",
  "liveReload": true,
  "verbose": true
}

If we don't specify "proxy", our app will have hot reloading enabled, but only if we access it via http://localhost:4200 . Unfortunately, if we do that, presumably all of our requests will attempt to access the server running at 4200 rather than 3000, and will therefore fail.

However, if we set the proxy, we can get both hot reloading and our backend API calls working as long as we load our app in-browser at http://localhost:4200/ rather than http://localhost:3000/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment