Before doing any extra development on the main code base I took a liberty to clean it up. It works the same as before but with the following changes:
created config.json
You can configure your mongoDB config here as well as server port
created .gitignore
added node_modules to the ignored list to avoid committing it by accident
restructured app structure
app.js - a dummy starting the whole server
libs/ - folder with modules and custom JavaScript
libs/server/ - folder with Express and server code
libs/server/views/ - folder with Jade templates
libs/server/public/ - folder with support scripts and CSS for Jade templates
libs/server/routes/ - server routes
lots of JS code cleanups
updated Express
Newer express requires a separate installation of all middlewares. You might need to run npm install before running the project
add logger to a server
using monk to get data from MongoDB
changed demo Jade page to load JavaScript separately
Before doing any extra development on the main code base I took a liberty to clean it up. It works the same as before but with the following changes:
created config.json You can configure your mongoDB config here as well as server port
created .gitignore added node_modules to the ignored list to avoid committing it by accident
restructured app structure app.js - a dummy starting the whole server libs/ - folder with modules and custom JavaScript libs/server/ - folder with Express and server code libs/server/views/ - folder with Jade templates libs/server/public/ - folder with support scripts and CSS for Jade templates libs/server/routes/ - server routes
lots of JS code cleanups
updated Express Newer express requires a separate installation of all middlewares. You might need to run
npm install
before running the projectadd logger to a server
using monk to get data from MongoDB
changed demo Jade page to load JavaScript separately
jsHint-ed every file http://jshint.com/ to keep code error free
setup for tests It does not have proper tests but you can execute them by
npm test
replaced “ with ‘ to keep code consistent
adding basic 404 for non existing routes