const express = require('express');
const qs = require('qs');
const app = express()
app.post('/login', async (req, res) => {
console.log("Dbg " + req.url + " req.body: " + req.body);
req.on('data', (data) => {
console.log("Dbg " + req.url + " req.on('data') data:" + data);
});
req.on('end', () => {
console.log("Dbg " + req.url + " req.on('end')" );
});
console.log("Dbg " + req.url + " func end");
res.send("ok");
});
app.get('/', (req, res) => {
res.send(`
<form action="/login" method="post">
<input type="text" name="id" value="id1">
<input type="password" name="pw" value="pw1">
<button type="submit">제출</button>
</form>
`);
});
app.listen(3000, () => {
console.log('Server listening on http://localhost:3000 ...');
});