I’m somewhat of a beginner to ember, I’ve used it a lot before it’s recent 1.0 release and it’s my first time useing ember-cli although I’m familiar enough with rails so it’s making sense so far.
I’m getting really confused when it comes to connecting the app to a server and database though. I’m just a little confused on how all that works, I’ve been fiddling with express and mongodb or mongoose and I’m really liking how simple that is to understand.
I’m just confused on how to deploy that in a production scenario, there seems to be a lot of information out there that’s not done yet or is ‘not recommended for production’ so I keep hitting walls.
Doing a little research here I found this post Using both ember routes and express routes but where would I put the ember-cli app in context with an express app? Would it go in the public folder? Or in the root? Is this not the right way to do it at all.
I’ve heard that the default server that is included with ember-cli is not for production, is that true? If so that’s where my confusion is, what then is the correct way to deploy this app/website with a production server/database via ember-cli
If you want to see a template/example using SailsJS (which is built on top of express) that is being used in production check out https://github.com/artificialio/sane
There are lots of improvements coming soon but you should be able to just clone it and get started with coding.
No, but you can soup it up depending on what you need to make it production ready, and deploy as you normally would, except point static to serve files from dist/. If you’re on Sails, then Artificial’s stack (@GlobeCoder) is the best way to go. I played around with it last weekend and it went great.
The way I like to do it is to use Express as just a JSON API and deploy separately. Then develop the Ember app on a CLI and deploy the distributable however you wish (on a CDN, some self-hosted solution, via NGINX, etc). This has the benefit of setting you up for a very modular architecture as you grow your app.
I’m trying out the SANE stack now but I’m having some problems getting things to work. So you just had the API and the App on separate servers basically and connected them with CORS or something similar? Is that correct?
Yup. Cors + JSON Web Tokens. For development, I just have both running locally, though sometimes I connect to the staging API using the --proxy flag in Ember CLI.