Skip to content

Instantly share code, notes, and snippets.

@tomasdev
Created February 3, 2018 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomasdev/7ef3bdef0c11c768b87a799cf3518fb4 to your computer and use it in GitHub Desktop.
Save tomasdev/7ef3bdef0c11c768b87a799cf3518fb4 to your computer and use it in GitHub Desktop.
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