Skip to content

Instantly share code, notes, and snippets.

@t8g
Created December 17, 2013 08:29
Show Gist options
  • Save t8g/8001771 to your computer and use it in GitHub Desktop.
Save t8g/8001771 to your computer and use it in GitHub Desktop.
Formation Angular : fake.js
{
"name": "fake",
"version": "0.0.0",
"license": "BSD-2-Clause",
"dependencies": {
"lodash": "~2.4.1",
"express": "~3.4.7",
"node-uuid": "~1.4.1"
}
}
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