Created
December 17, 2013 08:29
-
-
Save t8g/8001771 to your computer and use it in GitHub Desktop.
Formation Angular : fake.js
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
{ | |
"name": "fake", | |
"version": "0.0.0", | |
"license": "BSD-2-Clause", | |
"dependencies": { | |
"lodash": "~2.4.1", | |
"express": "~3.4.7", | |
"node-uuid": "~1.4.1" | |
} | |
} |
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
var express = require('express') | |
, http = require('http') | |
, _ = require('lodash') | |
, uuid = require('node-uuid') | |
; | |
var app = express(); | |
// all environments | |
app.set('port', process.env.PORT || 3000); | |
app.use(express.favicon()); | |
app.use(express.logger('dev')); | |
app.use(express.bodyParser()); | |
app.use(express.methodOverride()); | |
//app.enableViewRouting(); | |
app.use(express.static(__dirname + '/app')); | |
app.get('/users', function(req, res) { | |
res.send({ | |
id: uuid.v1(), | |
name: 'Thomas' | |
}) | |
}); | |
http.createServer(app).listen(9000, function(){ | |
console.log('Express server listening on port 9000'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment