Created
March 5, 2013 09:16
-
-
Save hokaccha/5088996 to your computer and use it in GitHub Desktop.
GRP test2
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'); | |
var http = require('http'); | |
var app = express(); | |
app.get('/', function(req, res) { | |
res.send( | |
'<body>' + | |
'<form action="/a" method="POST">' + | |
'<input type="text" name="foo">' + | |
'<input type="submit">' + | |
'</form>' | |
); | |
}); | |
app.post('/a', function(req, res) { | |
res.redirect('/a'); | |
}); | |
app.get('/a', function(req, res) { | |
res.send('a'); | |
}); | |
http.createServer(app).listen(3030); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment