Ember and Drupal

I’ve created a homepage in the Drupal backend and want to display it in my Ember frontend, I already did set up an API endpoint in Drupal to expose the content of the homepage. How can fetch the data in my Ember frontend and render it on my homepage.

In broad strokes you need a few things:

  • An Ember app
    • at least one route, which fetches the content
    • a template for your route, which renders the content
  • A way to serve your Ember app, obviously in dev mode that’s as simple as running the ember dev server but in a deployed environment you’ll want a static file server configured to serve a “single page app” (it looks like Drupal has a SPA module but I don’t know anything else about it)
  • The endpoint which you already have - I will say that that it’s ideal if the content it serves is in JSON format. If your endpoint is serving HTML then you may want to rethink your architecture here.

I’d recommend reading the guides or tutorial to get you started with a basic app with a route and route template and (most likely) a fetch call in your route model hook.