Savings-Calc

node v8.9.3
version: 21.0.0
endpointsharetweet
var express = require("@runkit/runkit/express-endpoint/1.0.0"); var app = express(exports); var isInteger = require("is-integer"); app.get("/:ticket_volume", (req, res) => { var ticket_volume = `${req.params.ticket_volume}` if (Number.isInteger(parseInt(ticket_volume))) { var tickets = ticket_volume * 0.4; var savings = tickets * 3.6; res.send({ "tickets": tickets, "savings": savings }); } else { res.status(500); res.send("Error"); } })
Loading…

no comments

    sign in to comment