Created
March 5, 2013 08:28
-
-
Save hokaccha/5088799 to your computer and use it in GitHub Desktop.
PRG test
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('/b'); | |
}); | |
app.get('/b', function(req, res) { | |
res.send('b'); | |
}); | |
http.createServer(app).listen(3030); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment