Created
February 3, 2018 21:04
-
-
Save tomasdev/7ef3bdef0c11c768b87a799cf3518fb4 to your computer and use it in GitHub Desktop.
This file contains 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 bodyParser = require('body-parser'); | |
var app = express(); | |
app.use(bodyParser.urlencoded({ | |
extended: true | |
})); | |
app.use(bodyParser.json()); | |
app.get('/', (req, res) => { | |
res.send(`<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"> | |
<title>Sample</title> | |
</head> | |
<body> | |
<form action="/post" method="post"> | |
<input name="field1" type="hidden" value="61a18fba0c44809e2bf5e4454c67836187a6a582"> | |
<input name="session[username_or_email]" type="text" placeholder="Username or email" value=""> | |
<input name="session[password]" type="password" placeholder="Password" value=""> | |
<input type="submit" value="Sign In" class="submit button selected" id="allow"> | |
</form> | |
</html>`); | |
}); | |
app.post('/post', (req, res) => { | |
res.json(req.body); | |
}); | |
app.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment