Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Setup package.json to use npm automated install. Also added .gitignor…

…e for node_modules
  • Loading branch information...
commit 13a97e506eee924b9aeb2523333f099b705f05e0 1 parent 3e88145
@robrighter authored
Showing with 13 additions and 9 deletions.
  1. +10 −4 README.md
  2. +3 −5 bin/initproject.sh
View
14 README.md
@@ -1,7 +1,7 @@
Node Boilerplate Version 2
==========================
*Requires Node v0.6.6 (or newer)*
-node-boilerplate takes html-boilerplate, express, connect and Socket.IO and organizes them into a ready to use website project. Its a fast way to get working on your Node website without having to worry about the setup. It takes care of all the boring parts, like setting up your views, 404 page, 500 page, getting the modules organized, etc...
+node-boilerplate takes html-boilerplate, express, connect, jade and Socket.IO and organizes them into a ready to use website project. Its a fast way to get working on your Node website without having to worry about the setup. It takes care of all the boring parts, like setting up your views, 404 page, 500 page, getting the modules organized, etc...
Node Boilerplate has 4 goals:
@@ -26,19 +26,25 @@ To run the boilerplate template app:
Go to http://0.0.0.0:8081 and click on the send message link to see socket.io in action.
+Additional Features:
+
+1. Creates a package.json file consistent with associated best practices (http://blog.nodejitsu.com/package-dependencies-done-right)
+2. Adds .gitignore for the node_modules directory
+3. Includes 404 page and associated route
+4. Includes 500 page
To add additional modules:
-You can git clone any other modules into the lib folder. Any modules cloned into the git folder can be required as global modules ie.. require('somemodule').
+Update the package.json file to include new module dependancies and run 'npm install'.
-**If you have a different set of default modules that you like to use, the structure is setup such that you can fork the project and replace the modules in the lib directory and the initproject.sh script will initialize projects with your new set of modules.**
+**If you have a different set of default modules that you like to use, the structure is setup such that you can fork the project and replace the module dependancies outlined in the ./templates/apps/package.json file to best fit your needs and the initproject.sh script will initialize projects with your new set of modules.**
Deployment
===============
node-boilerplate is setup to be easily deployed on a Joyent Node SmartMachine. This means that:
-1. The version of Node is defined in config.json
+1. The version of Node is defined in config.json and in package.json
2. The main script to run is server.js
3. The web server port is pulled from process.env.PORT
View
8 bin/initproject.sh
@@ -9,6 +9,8 @@ mkdir ./models
echo "Copying Markup and CSS BoilerPlate..."
cp ./templates/app/server.js ./server.js
+cp ./templates/app/package.json ./package.json
+cp ./templates/app/.gitignore ./.gitignore
curl https://raw.github.com/h5bp/html5-boilerplate/master/css/style.css > ./static/css/style.css
cp ./templates/views/500.jade ./views/500.jade
cp ./templates/views/404.jade ./views/404.jade
@@ -18,11 +20,7 @@ cp ./templates/js/script.js ./static/js/script.js
# TODO copy over the models
echo "Setting up the dependancies from NPM..."
-npm install connect
-npm install express
-npm install jade
-npm install mongoose
-npm install socket.io
+npm install
echo "Removing the stuff you dont want..."
rm -rf .git
Please sign in to comment.
Something went wrong with that request. Please try again.