Best way to use express with ember-cli and grunt


Is any suggestions for using express, ember-cli, grunt for the project?


I suggest ember-cli.

Edit: Take a look at my ember-cli example:


@broerse, thanks for your reply. This is not what i am looking for. It does not have an express server file.


ember-cli uses Express 4.12.3 when you run ember s

I don’t seem to understand the question then. Do you want to serve json on the backend with Express to your ember-cli app?


It does use express, and it’s extensible. Here is an example of something I threw together on how you can extend the ember-cli express instance… to add middleware/routes/whatever. Disregard the example code, it’s shit I threw together for an unrelated demo.

This server/index.js module will be invoked as expected, and passed in the instance (line 40).


@broerse, yes i want to serve json on the backend with express.


@jasonmit, thanks for your reply. I want to serve json response with express for my ember app. This are all the question which is popping me

How ember-cli serving static files and can we use same port number for my express backend which serve json response?

AFAIK when we use broccoli there is no need to use grunt:watch task for frontend assets but for backend we have to use grunt:watch to look for changes in the express code (to restart the node server). When we restart the node server (using nodemon), is there any conflict occurs between ember-cli running node server and grunt running node server?


Can’t help with that but I used in the past for this with success. Perhaps try it.


What I posted is a simple example of me adding middleware to the ember-cli express instance. You can add take that example and add routes which respond with json like you normally would with any express app.