Created
July 10, 2013 10:20
-
-
Save dirkk0/5965213 to your computer and use it in GitHub Desktop.
very simple express app. used to file a bug with cloud9.
This file contains hidden or 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'), | |
| 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