Getting votes via a local webserver

Installation

npm i express

Setting up a webserver

const express = require("express")
var bodyParser = require('body-parser')

const port = "YOUR_PORT"

const app = express() 
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({
    extended: true
  }));

app.post("/votewebhook", async (req, res) => {
    console.log(req.body)  
    res.sendStatus(201) 
})

app.listen(port, ()=>{
    console.log("running on port ", port)
})

Response

A response will look like this:

Last updated

Was this helpful?