# Which back end framework for node.js fits well with the Ember way: Express, Hapi, or Sails?

**URL:** <https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471>\
**Category:** Ember CLI\
**Created:** [August 25, 2016, 7:26pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471 "2016-08-25T19:26:39Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![alidcastano](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/alidcastano/32/12547_2.png) [@alidcastano](https://discuss.emberjs.com/u/alidcastano)\
**Post date:** [August 25, 2016, 7:26pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/1 "2016-08-25T19:26:39Z")

</div>

From what I found, there is three main players: Express, Hapi, and Sails.

The [Sane stack](https://github.com/sane/sane), using Ember and Sails, looked promising, but seemed to be discontinued.

There doesn’t seem to be any other prominent setups or conventions. I could only find a few, brief tutorials on getting set up with Express and Hapi, but they seemed to be outdated.

(Note: Another popular (non node.js) option that I considered is [EmberFirebase](https://www.firebase.com/docs/web/libraries/ember/quickstart.html), which seems dead simple to setup and get going; but I’m not sure how extensible it is, nor if it would be easy to exchange for a node.js solution if necessary.)

What backend framework would you recommend? With ember, would it be easier to use an unopiniated framework like express or an opinionated framework like Hapi? I know Ember has a specific way of doing things and I want to find a solution that fits well and better yet, that I know is widely used by the community.

---

<div class="post-metadata">

**Author:** ![rjoxford](https://avatars.discourse-cdn.com/v4/letter/r/96bed5/32.png) [@rjoxford](https://discuss.emberjs.com/u/rjoxford)\
**Post date:** [August 25, 2016, 11:58pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/2 "2016-08-25T23:58:09Z")

</div>

I’m still rocking with Sane stack. But my Ember project is just an old hobby that I don’t really have time for.

Have you seen [Seeds](http://seedsjs.com/)? I think they near enough took off from where Sane finished. Pretty similar project. But not sure how active they still are…

---

<div class="post-metadata">

**Author:** ![indr](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/indr/32/12523_2.png) [@indr](https://discuss.emberjs.com/u/indr)\
**Post date:** [August 26, 2016, 8:33am UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/3 "2016-08-26T08:33:34Z")

</div>

> [@alidcastano](#):
>
> From what I found, there is three main players: Express, Hapi, and Sails.

There is a difference between ‘web framework’ and ‘web application framework’. Sails doesn’t fit in your enumeration, as it tries to be a full web application framework. Talking about Express and Hapi, one has also to mention [Koa](http://koajs.com/), which is the youngest among them and relaying on ES6 generators.

> [@alidcastano](#):
>
> The Sane stack, using Ember and Sails, looked promising, but seemed to be discontinued.
> 
> There doesn’t seem to be any other prominent setups or conventions. I could only find a few, brief tutorials on getting set up with Express and Hapi, but they seemed to be outdated.

I was looking for a web application framework in the node ecosystem about a month ago. I decided to give Sails a try, only to find out it was a bad decision. I’ve found out it’s created and maintained almost by a [single person](https://github.com/mikermcneil). And that guy seems to not respond on GitHub except to keep mentioning that Sails is still alive. But it’s not maintained, it has many bugs, it’s outdated, the code base is imo a mess and it’s dangerous and a security risk. I can’t even imagine how people use that in production. There is a group or company among [tjwebb](https://github.com/tjwebb) which created the addons/plugins (in Sails it’s called a hook (?!)) `sails-auth` and `sails-permission`. They decided to split (read here an [explanation of tjwebbs version](https://github.com/balderdashy/sails/issues/3429#issuecomment-165004024)) and started to create [Trails](https://github.com/trailsjs/trails). From that repository description:

> Trails is a modern, community-driven web application framework for node.js. It builds on the pedigree of Rails and Grails to accelerate development by adhering to a straightforward, convention-based, API-driven design philosophy.

But Trails is nowhere near ready to use. To be honest, I’m not waiting for it. On my journey fixing bugs in `sails`, `sails-auth`, `sails-permissions` and `waterline` (an ORM used by Sails from the same creator) I lost too much trust.

For my project which has left MVP status and I start to show and invite people I know, I’m still running Sails as back-end. But as I mentioned above, it’s in my opinion a security risk:

- It uses Express 3.x which was deprecated and you can read on their website:

> Express 3.x IS NO LONGER MAINTAINED Known and unknown security and performance issues in 3.x have not been addressed since the last update (1 August, 2015). It is highly recommended to use the latest version of Express.

- About Sails: building for `production` means there is different code paths (for performance reason I read somewhere). I figured some of them read my config files different. I couldn’t have two data adapters defined.

- `sails` has so called ‘blueprints’, automagical CRUD endpoints for models/resources. Their documentation says they are safe to use in production. My unit tests against those endpoints tell me something different. I can update properties I am not supposed to, but for this, `sails-permissions` should jump in.

- `sails` has different data adapters and stores. They have a convenient disk store… without unique key enforcement…

- `sails-auth` uses PassportJS which is very nice, but, make sure you ‘reopen’ `User` and `Passport` and make email address and passwort a required field.

- `sails-auth`s logout endpoint is invokable with a GET request (let’s add an image or script tag, and the user is logged out 😄 )

- `sails-permissions` turns your 403er (or better 404er) in 500er. Not something you want to disclose.

I could go on with this list. I could also extract these and more minor fixes from my codebase if you are interested. Oh, and I have ember-simple-auth authenticator and an ember-data adapter that plays nice with Sails RESTful requests/responses aswell as with ember-data DS.Errors, ember-cp-validation and ember-intl. Tell me if you need any of these.

> [@alidcastano](#):
>
> What backend framework would you recommend? With ember, would it be easier to use an unopiniated framework like express or an opinionated framework like Hapi? I know Ember has a specific way of doing things (e.g. moving away from MVC framework) and I want to find a solution that fits well and better yet, that I know is widely used by the community.

So, to come back to your question: There is nothing I could find in the fields of ‘web application frameworks’. Everything that builds on top of Sails is useless (Sane?) or already abandoned (Seeds?). What you mean by ‘moving away from MVC framework’ I don’t understand. But Ember doesn’t have a specific way of doing things regarding on how it talks to your API. Therefore it doesn’t matter how opinionated your back-end is.

There is one more thing I was looking at. If you find yourself in a situation where you might look at microservices to do all your work, there is an interesting framework called [SenecaJS](http://senecajs.org). The core of SenecaJS and many plugins are production ready I guess, but plugins around front-end needs are poorly crafted and neither `seneca-user`, `seneca-auth` nor `seneca-web` is production ready. It’s also nice to build a Prototype/MVP and that sort… But what I want to say is: If you are looking at SOA or microservices, you don’t need a web application framework that talks to databases or does database migrations.

---

<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:** [August 26, 2016, 12:01pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/4 "2016-08-26T12:01:00Z")

</div>

PouchDB can be run on Node but I like CouchDB more. It is API compatible. I also use [https://cloudant.com/](https://cloudant.com/) and it is free for small project like [http://bloggr.exmer.com/](http://bloggr.exmer.com/) ( [GitHub - broerse/ember-cli-blog: Tom Dale's blog example updated for the Ember CLI](https://github.com/broerse/ember-cli-blog) )

See also: [https://github.com/nolanlawson/ember-pouch](https://github.com/nolanlawson/ember-pouch)

---

<div class="post-metadata">

**Author:** ![acorncom](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/acorncom/32/12198_2.png) [@acorncom](https://discuss.emberjs.com/u/acorncom)\
**Post date:** [August 26, 2016, 1:18pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/5 "2016-08-26T13:18:19Z")

</div>

Two other JS frameworks I’ve looked at but haven’t used yet (used or worked on by Ember folks):

> **[302 denali - JS.ORG](https://denali.js.org/)**
>
> Dedicated to JavaScript and its awesome community since 2015

[http://adonisjs.com/](http://adonisjs.com/)

Denali is more clearly tilted toward Ember needs.

But to answer your larger question, the Node backend framework options are still quite balkanized with no commonly agreed on solution 😟

---

<div class="post-metadata">

**Author:** ![tsantos83](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/tsantos83/32/14256_2.png) [@tsantos83](https://discuss.emberjs.com/u/tsantos83)\
**Post date:** [August 26, 2016, 1:29pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/6 "2016-08-26T13:29:03Z")

</div>

I’ve been using [koa.js](https://github.com/koajs/koa) + [sequelize](https://github.com/sequelize/sequelize) on the backend for a little less than a year now and things are going smooth.

---

<div class="post-metadata">

**Author:** ![indr](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/indr/32/12523_2.png) [@indr](https://discuss.emberjs.com/u/indr)\
**Post date:** [August 26, 2016, 3:12pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/7 "2016-08-26T15:12:33Z")

</div>

Thank you for the pointer on AdonisJs. I’m going to try this one. Denali states on their page:

> Heads up! Denali is still in alpha. We don’t recommend using it for production apps just yet.

---

<div class="post-metadata">

**Author:** ![sheriffderek](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/sheriffderek/32/10619_2.png) [@sheriffderek](https://discuss.emberjs.com/u/sheriffderek)\
**Post date:** [August 30, 2016, 9:34pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/8 "2016-08-30T21:34:59Z")

</div>

> [@rjoxford](#):
>
> Seeds

seems pretty great, but [this](http://docs.seedsjs.com/#intro)

> “# If you already have io.js installed…”

makes me wonder if they are keeping things up to date.

---

<div class="post-metadata">

**Author:** ![sheriffderek](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/sheriffderek/32/10619_2.png) [@sheriffderek](https://discuss.emberjs.com/u/sheriffderek)\
**Post date:** [August 30, 2016, 9:40pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/9 "2016-08-30T21:40:47Z")

</div>

I like how denali.js says right away

> You won’t find any templating languages, views, or other HTML rendering support out of the box. Denali is unapologetically focused on APIs first.

because I’m always confused why my backend has a templating solution when I’m going to use Ember for all of that jazz anyways.

PLUS, look how well they play together [Denali and Ember](https://www.youtube.com/watch?v=1kW5ByHqeLU)

---

<div class="post-metadata">

**Author:** ![jhliberty](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jhliberty/32/10495_2.png) [@jhliberty](https://discuss.emberjs.com/u/jhliberty)\
**Post date:** [September 1, 2016, 3:07pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/10 "2016-09-01T15:07:26Z")

</div>

Thanks for posting this - Will update that part of the docs haha. The current release of Seeds is targeted at LTS Node v4+.

The next release of Seeds will target node 6+ and we are moving away from Sails to a newer JSON API framework called [Lux](https://github.com/postlight/lux) as soon 1.0 is released (Currently 1.0.0-rc.5 - almost there!)

To answer the OP take a look at Lux for a backend framework for Ember! It’s really close to 1.0 release and is really clean, lightweight, fast and focused on developer happiness.

> ### Features

> - Automatic CRUD actions in controllers
> - Automatic pagination, sorting, filtering via query params in controllers
> - CLI for eliminating boiler plate
> - [JSON API](http://jsonapi.org/) 1.0 compliant out of the box
> - Optimized database queries based on serialized attributes and associations
> - Highly extensible - just write reusable JavaScript functions
> - Pairs nicely with client-side JavaScript applications 🍷
> - Easy to contribute
> - Routes are stored and accessed via a `Map` not an `Array`
> - Embraces ES2015 and beyond
> - Classes
> - Modules
> - Promises & async/await
> - Arrow Functions
> - etc.

---

<div class="post-metadata">

**Author:** ![Carlos\_Galveias](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@Carlos\_Galveias](https://discuss.emberjs.com/u/Carlos_Galveias)\
**Post date:** [September 2, 2016, 12:27am UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/11 "2016-09-02T00:27:22Z")

</div>

I think express is a awesome choice, i love it.

I’ve made a small API implementation that although it is meant to develop the back end using google cloud (Functions or GAE) , it is a standard express server that you can use anywhere. It even has a generic router that handles all CRUD operations for all your models out of the box and you can use pagination , etc using query params. By default it auto populate relationships that i find good to optimize the way ember data works and saves a lot of small queries to db. You need to set the ember-data to use embedded records. If you need extra router process, you can easely expand the router and only add what extra code you need but reuse the generic part as well.

> **[gccli](https://www.npmjs.com/package/gccli)**
>
> Command line utility to create google could function project. Latest version: 0.1.5, last published: 5 years ago. Start using gccli in your project by running \`npm i gccli\`. There are no other projects in the npm registry using gccli.

1. Install
2. Define your models (uses waterline/sails ORM)
3. Run Done! generic CRUD api just like ember likes it.

---

<div class="post-metadata">

**Author:** ![alidcastano](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/alidcastano/32/12547_2.png) [@alidcastano](https://discuss.emberjs.com/u/alidcastano)\
**Post date:** [October 16, 2016, 12:03am UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/12 "2016-10-16T00:03:11Z")

</div>

I checked out Lux, it looks promising and simple to use, but the documentation is scarce. Would you recommend it for a beginner?

---

<div class="post-metadata">

**Author:** ![zacharygolba](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/zacharygolba/32/12699_2.png) [@zacharygolba](https://discuss.emberjs.com/u/zacharygolba)\
**Post date:** [November 12, 2016, 5:12pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/13 "2016-11-12T17:12:19Z")

</div>

Hi I’m the author of Lux! The docs are scarce but it is something that we are actively working on. To compensate for the lack of documentation, I try to do the best I can to respond to issues as well as messages in our [Gitter room](https://gitter.im/postlight/lux). I recommend using Lux to beginners as it’s strong opinions keep the workflow and mental model simple (much like Ember).

---

<div class="post-metadata">

**Author:** ![Alexx](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/alexx/32/13005_2.png) [@Alexx](https://discuss.emberjs.com/u/Alexx)\
**Post date:** [March 28, 2017, 8:11am UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/14 "2017-03-28T08:11:54Z")

</div>

In my opinion Express.js is the best framework for Node.js You should check this article - [The best Node.js framework for your project: Express.js, Koa.js or Sails.js](https://www.cleveroad.com/blog/the-best-node-js-framework-for-your-project--express-js--koa-js-or-sails-js)

---

<div class="post-metadata">

**Author:** ![jacobq](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jacobq/32/14827_2.png) [@jacobq](https://discuss.emberjs.com/u/jacobq)\
**Post date:** [March 30, 2017, 2:26pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/15 "2017-03-30T14:26:46Z")

</div>

Just a quick ping…since [Lux shipped v1.0.0](https://github.com/postlight/lux/releases/tag/1.0.0) about 5 months ago now I am wondering if Seeds is still alive. The [docs site](http://docs.seedsjs.com/) appears to be down, and I don’t see any open PRs or Projects on the [Seeds github repository page](https://github.com/terminalvelocity/seeds.js). Bad news?

---

<div class="post-metadata">

**Author:** ![Kaari](https://avatars.discourse-cdn.com/v4/letter/k/45deac/32.png) [@Kaari](https://discuss.emberjs.com/u/Kaari)\
**Post date:** [September 13, 2017, 3:51pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/16 "2017-09-13T15:51:56Z")

</div>

I also used sequelize, with express for a time. I really liked it, way more than waterline, more permissive, easy to set up and great documentation.

Haven’t tried this stack recently thought, but Koa is looking at me, along with loopback.

---

<div class="post-metadata">

**Author:** ![Nikos](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/nikos/32/13057_2.png) [@Nikos](https://discuss.emberjs.com/u/Nikos)\
**Post date:** [September 20, 2017, 9:21pm UTC](https://discuss.emberjs.com/t/which-back-end-framework-for-node-js-fits-well-with-the-ember-way-express-hapi-or-sails/11471/17 "2017-09-20T21:21:48Z")

</div>

Denali looks interesting.
