Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ end
For instance, mounting `mount_ember_app :frontend, to: "/frontend"` will handle a
`format: :html` request to `/frontend/posts`.
*Note:* If you specify a custom path, you must also update the `rootURL` in `frontend/config/environment.js`. See [Mounting multiple Ember applications](#mounting-multiple-ember-applications) for more information.
*Note:* Requests without `Accept: text/html` — `curl`'s default, most health checkers — skip this route and receive the raw `index.html` from the asset handler.
* `controller` - Defaults to `"ember_cli/ember"`
* `action` - Defaults to `"index"`

Expand Down Expand Up @@ -195,6 +196,8 @@ Rails still renders the application's `index.html`, but reads it from the
development server rather than from disk. The root-relative URLs in that
document are rewritten to point at the development server, so the browser
loads the application's modules — and Vite's HMR client — from it directly.
The rewriting covers every tag the server emits: Vite externalizes even the
document's inline bootstrapping script.
Changes to the Ember application are hot-reloaded without reloading the page,
and without restarting Rails.

Expand Down Expand Up @@ -238,6 +241,11 @@ end
With `host: "0.0.0.0"`, Rails itself reaches the development server through the
loopback interface.

Vite's default CORS setting allows localhost origins only: to open the page on
a LAN IP or a custom domain, configure
[`server.cors`](https://vite.dev/config/server-options#server-cors) in
`vite.config.*`.

The development server's output is written to
`log/ember-<app>.<environment>.log`.

Expand Down Expand Up @@ -469,6 +477,9 @@ helper in your view:
The `body` block argument and the corresponding call to `body.append` in the
example are both optional, and can be omitted.

`render_ember_app` emits a complete HTML document, so render it with the
layout disabled (see below).

### Serving Rails-generated CSS

For more information on how to work with EmberCLI-generated stylesheets, refer
Expand Down
3 changes: 3 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ following differences in how `ember-cli-rails` treats it:
development server to every interface and name the browser-facing origin
separately: `dev_server: { host: "0.0.0.0", port: 4200, origin:
"http://localhost:4200" }`.
Opening the page on a LAN IP or a custom domain also needs `server.cors`
configured in `vite.config.*` — Vite's default allows localhost origins
only.

To opt out of the development server, disable it:

Expand Down