# Best way to use express with ember-cli and grunt

**URL:** <https://discuss.emberjs.com/t/best-way-to-use-express-with-ember-cli-and-grunt/8883>\
**Category:** Ember CLI\
**Created:** [September 30, 2015, 9:19pm UTC](https://discuss.emberjs.com/t/best-way-to-use-express-with-ember-cli-and-grunt/8883 "2015-09-30T21:19:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![maheshgowda\_s89](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@maheshgowda\_s89](https://discuss.emberjs.com/u/maheshgowda_s89)\
**Post date:** [September 30, 2015, 9:19pm UTC](https://discuss.emberjs.com/t/best-way-to-use-express-with-ember-cli-and-grunt/8883/1 "2015-09-30T21:19:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![broerse](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/broerse/32/9497_2.png) [@broerse](https://discuss.emberjs.com/u/broerse)\
**Post date:** [October 2, 2015, 2:33am UTC](https://discuss.emberjs.com/t/best-way-to-use-express-with-ember-cli-and-grunt/8883/2 "2015-10-02T02:33:20Z")

</div>

I suggest ember-cli.

Edit: Take a look at my ember-cli example: [GitHub - broerse/ember-cli-blog: Tom Dale's blog example updated for the Ember CLI](https://github.com/broerse/ember-cli-blog)

---

<div class="post-metadata">

**Author:** ![maheshgowda\_s89](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@maheshgowda\_s89](https://discuss.emberjs.com/u/maheshgowda_s89)\
**Post date:** [October 4, 2015, 5:44pm UTC](https://discuss.emberjs.com/t/best-way-to-use-express-with-ember-cli-and-grunt/8883/3 "2015-10-04T17:44:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![broerse](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/broerse/32/9497_2.png) [@broerse](https://discuss.emberjs.com/u/broerse)\
**Post date:** [October 4, 2015, 6:56pm UTC](https://discuss.emberjs.com/t/best-way-to-use-express-with-ember-cli-and-grunt/8883/4 "2015-10-04T18:56:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jasonmit](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jasonmit/32/182_2.png) [@jasonmit](https://discuss.emberjs.com/u/jasonmit)\
**Post date:** [October 5, 2015, 6:39am UTC](https://discuss.emberjs.com/t/best-way-to-use-express-with-ember-cli-and-grunt/8883/5 "2015-10-05T06:39:25Z")

</div>

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.

[https://github.com/jasonmit/locale-root-url/blob/master/server/index.js](https://github.com/jasonmit/locale-root-url/blob/master/server/index.js)

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

---

<div class="post-metadata">

**Author:** ![maheshgowda\_s89](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@maheshgowda\_s89](https://discuss.emberjs.com/u/maheshgowda_s89)\
**Post date:** [October 7, 2015, 6:55am UTC](https://discuss.emberjs.com/t/best-way-to-use-express-with-ember-cli-and-grunt/8883/6 "2015-10-07T06:55:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![maheshgowda\_s89](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@maheshgowda\_s89](https://discuss.emberjs.com/u/maheshgowda_s89)\
**Post date:** [October 7, 2015, 8:24am UTC](https://discuss.emberjs.com/t/best-way-to-use-express-with-ember-cli-and-grunt/8883/7 "2015-10-07T08:24:46Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![broerse](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/broerse/32/9497_2.png) [@broerse](https://discuss.emberjs.com/u/broerse)\
**Post date:** [October 7, 2015, 6:05pm UTC](https://discuss.emberjs.com/t/best-way-to-use-express-with-ember-cli-and-grunt/8883/8 "2015-10-07T18:05:43Z")

</div>

Can’t help with that but I used [GitHub - fortunejs/fortune: Non-native graph database abstraction layer for Node.js and web browsers.](https://github.com/fortunejs/fortune) in the past for this with success. Perhaps try it.

---

<div class="post-metadata">

**Author:** ![jasonmit](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jasonmit/32/182_2.png) [@jasonmit](https://discuss.emberjs.com/u/jasonmit)\
**Post date:** [October 7, 2015, 8:44pm UTC](https://discuss.emberjs.com/t/best-way-to-use-express-with-ember-cli-and-grunt/8883/9 "2015-10-07T20:44:34Z")

</div>

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.
