Skip to content

Instantly share code, notes, and snippets.

@dirkk0
Created July 10, 2013 10:20
Show Gist options
  • Save dirkk0/5965213 to your computer and use it in GitHub Desktop.
Save dirkk0/5965213 to your computer and use it in GitHub Desktop.
very simple express app. used to file a bug with cloud9.
var express = require('express'),
app = express();
app.use(express.bodyParser());
app.use(express.logger());
app.get('/', function(req, res){
res.send('Hello World');
});
app.post('/', function(req, res) {
console.log(req.body);
res.send(req.body);
});
var port = process.env.PORT || 8080
app.listen(port);
console.log('Express server started on port %s', port);
// curl -d '{"MyKey":"My Value"}' -H "Content-Type: application/json" http://127.0.0.1:8080/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment