You can use ember app-kit and swap out grunt-contrib-connect for grunt-express. Another thing you can do is to start an express app and write your ember app inside the public/javascripts directory and work from there until you setup your own build process. Thereās also brunch-with-ember-reloaded, which uses Brunch as a build tool. You can setup your express back-end like this: http://hackerpreneurialism.com/post/43379675961/nodejs-with-bunch-io
This is awesome, I was just doing the same thing now, but still figuring out how to put express code, changing the parts of Gruntjs(too much stuff there) etc! Thanks I think you should write a blog post or a gist or a sample repo on converting ember app-kit to a ember-express-app-kit? That would be helpful to me and every others in the future.
Replacing grunt-contrib-connect to grunt-express or grunt-contrib-express, do we still have to create a server on expressjs app.js file or just module.exports= app , and then in the connect express grunt file there we will define server hostname , port and the entry point ??
With grunt-express and ember-app-kit, you make a new file under the tasks folder called express and module.exports your preferences from there, just like the connect-file.
var express = require(āexpressā);
module.exports = server = express();
This is all you need to get setup. grunt-express doesnāt want you to call the listen() function from within your server module, because the express task takes care of that for you.
@vysakh0 A disclaimer: Iām a novice Ember developer myself but I built and maintain Mimosa. I canāt say that more people prefer mimosa, mimosa is still a small fry in the larger scheme of things. But going back quite some ways Ember developers have been asking for specific features in Mimosa to cater to their needs. There are more example Ember apps out there built using Mimosa than any other MVC technology.
I also donāt know much about Grunt, so other than some basic differences I canāt really comment much on how great or not-great or hard to get started with it might be compared to Mimosa.
But I do know that if you want to build an ember app with express, you are literally 5 commands away from getting started.
@ulisesrmzroche that was very helpful (great question @vysakh0) but I am sort of stuck. Can you post more info on the Express EAK setup and usage? Example project?
Sorry for the long noob question but I did exactly what you stated and am not sure what to do next. Assume I have to replace the connect tasks in Gruntfile.js ala:
grunt.registerTask('server', "Run your server in dev w/ auto-rebuilding.", [
'build:debug',
//'connect:server',
'express:server',
'watch'
]);
But all I get is an error that Express has no server task.
Also do I need to copy and or modify these functions from the connect task?
Do you have both express and grunt-express declared in your package.json? They both need to be declared for the wiring to work. The grunt task is correct.
I didnāt use any of the functions from the connect task, instead relying on grunt-express and express to handle routing and middlewares. Havenāt run into any problems with the semaphores, so iāve ignored the lock function till now.
@Brendan For a grunt based ember, express app, after I asked the question I looked at Ember App kit and grunt-angular-express repo and came up with this sample template, might give some idea https://github.com/vysakh0/ember-express . Now going to try mimosa way and see what suits me
I still get the same warnings after making those changes @ulisesrmzroche.
Brendans-MacBook-Pro:cvr Brendan$ grunt server
/Users/Brendan/Documents/EAK/cvr/tasks/options/express.js:5
server: āserverā
^
Loading "Gruntfile.js" tasks...ERROR
>> SyntaxError: Unexpected token ILLEGAL
Warning: Task "server" not found. Use --force to continue.
Aborted due to warnings.
I will take a look at this project @vysakh0. Thanks so much.
I have created a github repo called ember-sass-express-starter. Client-side project layout is almost exactly the same as the one generated by ember-tools. Thatās because this project is designed to work with ember-tools.
The reason I created this project is because I find Ember App Kit overly complicated. I mean have you looked at that Gruntfile? With ember-tools āit just worksā, and it is all abstracted away. The entire javascript and handlebars compilation is handled by ember-tools, and sass compilation is handled transparently by the node-sass express middleware.
As a result the project directory is very clean. pretty to look at, easy to understand for new developers. After many hours of looking at just about every possible ember boilerplate projects, I am very content with the way this project turned out.
For anyone using/wanting to use browserify, have a look here at emberate, which was based off of @ryanflorenceās loom-ember build-index.
Emberate generates a file that links all of your ember files so you can do browserify entry.js -o bundle.js along with some shimming, and you have a nice build. We also support PODS directory structure