forked from btford/angular-express-seed
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to Angular 1.0.7, jQuery 2.0.3 and Bootstrap 3.0
- Loading branch information
Showing
329 changed files
with
65,000 additions
and
7,257 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,57 @@ | ||
|
||
/** | ||
* Module dependencies. | ||
* Module dependencies | ||
*/ | ||
|
||
var express = require('express'), | ||
routes = require('./routes'), | ||
api = require('./routes/api'); | ||
api = require('./routes/api'), | ||
http = require('http'), | ||
path = require('path'); | ||
|
||
|
||
var app = module.exports = express(); | ||
|
||
// Configuration | ||
/** | ||
* Configuration | ||
*/ | ||
|
||
// all environments | ||
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(express.static(path.join(__dirname, 'public'))); | ||
app.use(app.router); | ||
|
||
app.configure(function(){ | ||
app.set('views', __dirname + '/views'); | ||
app.set('view engine', 'jade'); | ||
app.use(express.bodyParser()); | ||
app.use(express.methodOverride()); | ||
app.use(express.static(__dirname + '/public')); | ||
app.use(app.router); | ||
}); | ||
// development only | ||
if (app.get('env') === 'development') { | ||
app.use(express.errorHandler()); | ||
}; | ||
|
||
app.configure('development', function(){ | ||
app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); | ||
}); | ||
// production only | ||
if (app.get('env') === 'production') { | ||
// TODO | ||
}; | ||
|
||
app.configure('production', function(){ | ||
app.use(express.errorHandler()); | ||
}); | ||
|
||
// Routes | ||
|
||
// Routes | ||
app.get('/', routes.index); | ||
app.get('/partial/:name', routes.partial); | ||
|
||
// JSON API | ||
|
||
app.get('/api/name', api.name); | ||
|
||
// redirect all others to the index (HTML5 history) | ||
app.get('*', routes.index); | ||
|
||
// Start server | ||
/** | ||
* Start Server | ||
*/ | ||
|
||
app.listen(3000, function(){ | ||
console.log("Server started"); | ||
}); | ||
http.createServer(app).listen(app.get('port'), function () { | ||
console.log('Express server listening on port ' + app.get('port')); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"name": "application-name" | ||
, "version": "0.0.1" | ||
, "private": true | ||
, "dependencies": { | ||
"express": "3.0.0" | ||
, "jade": ">= 0.0.1" | ||
} | ||
"name": "application-name", | ||
"version": "0.0.1", | ||
"private": true, | ||
"dependencies": { | ||
"express": "~3.2.6", | ||
"jade": "~0.31.2" | ||
} | ||
} |
Oops, something went wrong.