1

New to Node.js here, coming over from rails. Working on an express.js project.

I'm finding that I have to re-address a bunch of design answers which are done for me in rails-- which is fine, but I don't always know if I'm doing a good job. These things include multi-environment config, database.yml, MVC structure, and testing.

I'm wondering if this is just part of the learning curve, or if this has all been done already in one of the many available express frameworks, available here: https://github.com/visionmedia/express/wiki

I'm also wondering if any one of these frameworks are particularly recommended.

Peter Ehrlich
  • 6,969
  • 4
  • 49
  • 65

1 Answers1

3

Here's a compilation of issues I've come across, some of which I've implemented, some I've not. Hopefully they'll be useful to others.

Development mode: watching file changes:

Can I tell foreman to reload the web app every time a request is made so I can develop decently?

EDIT: Nodemon may be preferable. For one, it doesn't frantically restart the server on coffee compile error.

How to use nodemon with .env files?

App Configuration structure:

ExpressJS How to structure an application?

App.js and Routing:

http://elegantcode.com/2012/01/20/taking-toddler-steps-with-node-js-express-routing/

Package management: git ignore node_modules?

http://www.mikealrogers.com/posts/nodemodules-in-git.html vs Should I check in node_modules to git when creating a node.js app on Heroku?

CoffeeScript compilation:

Can I run coffeescript in Heroku? and Foreman executing with coffee vs #app.use express.compiler(src: __dirname + "/../public", enable: ["coffeescript"])

Debugging:

Node-Inspector: http://grenzgenial.com/post/1210106964/debugging-node-js-with-node-inspector

Community
  • 1
  • 1
Peter Ehrlich
  • 6,969
  • 4
  • 49
  • 65
  • 1
    For testing I recommend mocha: https://github.com/visionmedia/mocha Express itself is flexible and pattern agnostic, you can use MVC and/or REST if you want and its really easy, take a look at my own node-rest-mvc-example: https://github.com/talentedmrjones/node-rest-mvc-example – talentedmrjones Sep 17 '12 at 01:13