This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for DIR in /home/*/node; do | |
PORT=[generate port based on crc32 of $DIR] | |
# somehow check if not running | |
NODE_ENV=dev NODE_PORT=$PORT node-dev $DIR/app.js | |
cat /etc/nginx/configs.avail/default-node.conf | \ | |
sed -e s/DIR/$DIR/ | \ | |
sed -e s/PORT/$PORT > /etc/nginx/configs.enabled/node-$DIR.conf | |
# somehow check if we actually created/changed a config here | |
if [ $changed -eq 1 ]; then | |
service nginx restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, dustx = require('dust-x') | |
/** | |
* Create the Express application. | |
*/ |
NewerOlder