Skip to content

Cleanup file tree #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
public/bower_components
39 changes: 28 additions & 11 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
var express = require('express'),
routes = require('./routes'),
api = require('./routes/api'),
bodyParser = require('body-parser'),
cookieParser = require('cookie-parser'),
favicon = require('serve-favicon'),
http = require('http'),
logger = require('morgan'),
path = require('path');

var app = module.exports = express();
Expand All @@ -21,22 +25,35 @@ var io = require('socket.io').listen(server);
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
// uncomment after placing your favicon in /public
//app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(express.static(path.join(__dirname, 'public')));
app.use(app.router);

// development only
// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
app.use(express.errorHandler());
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: err
});
});
}

// production only
if (app.get('env') === 'production') {
// TODO
};

// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: {}
});
});

/**
* Routes
Expand Down
24 changes: 24 additions & 0 deletions bin/postinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

# check for bower installation (global / local)
# and invoke `bower install`

echo "installing dependencies with bower..."

if [ -f /usr/local/bin/bower ]
then
BOWER=/usr/local/bin/bower

elif [ -f ./node_modules/bower/bin/bower ]
then
BOWER=./node_modules/bower/bin/bower

# we should never reach this
else
echo "fatal: Something went wrong on install - bower not found!"
return 1
fi

$BOWER install

return 0
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"socket.io": "~0.9.16",
"express": "~3.2.6",
"jade": "~0.31.2"
"body-parser": "~1.9.1",
"bower": "~1.3.12",
"cookie-parser": "~1.3.3",
"express": "~4.10.0",
"jade": "~1.7.0",
"morgan": "~1.4.1",
"serve-favicon": "~2.1.6",
"socket.io": "~1.1.0"
},
"scripts": {
"postinstall": "./bin/postinstall"
}
}
19 changes: 0 additions & 19 deletions public/bower_components/angular-route/.bower.json

This file was deleted.

54 changes: 0 additions & 54 deletions public/bower_components/angular-route/README.md

This file was deleted.

Loading