-
-
Save robertklep/94a5616529dd519385baa7f8100b942a 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
'use strict'; | |
const express = require('express'); | |
let app = express(); | |
let server = app.listen(3000); | |
app.use(require('body-parser').urlencoded({ extended : true })); | |
app.get('/', (req, res) => { | |
res.send(` | |
<form method="post" action="/"> | |
<input type="text" placeholder="Enter Tag here" class="gui-input" name="reply_message"> | |
<input type="text" placeholder="Enter Label for Decision" class="gui-input" name="decision[0][label]" value="Interested"> | |
<input type="text" placeholder="Enter decision keywords here" class="gui-input" data-role="tagsinput" name="decision[0][keyword]" value="Interested, call me"> | |
<input type="text" placeholder="Enter Label for Decision" class="gui-input" name="decision[1][label]" value="Not Interested"> | |
<input type="text" placeholder="Enter decision keywords here" class="gui-input" data-role="tagsinput" name="decision[1][keyword]" value="not interested, not"> | |
<input type="text" placeholder="Enter Label for Decision" class="gui-input" name="decision[2][label]" value="Call Later" > | |
<input type="text" placeholder="Enter decision keywords here" class="gui-input" data-role="tagsinput" name="decision[2][keyword]" value="Interested, call me, later"> | |
<button class="button btn-primary" type="submit">Submit </button> | |
`); | |
}); | |
app.post('/', (req, res) => { | |
res.send(`<pre>${ JSON.stringify(req.body, null, 2) }</pre>`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment