Skip to content

Commit

Permalink
Auto int parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Duddino committed Nov 5, 2022
1 parent 4d54db1 commit f41fabc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ app.get('/:rpc', async function(req, res) {
try {
if (allowedRpcs.includes(req.params["rpc"])) {

const params = req.query.params ? req.query.params.split(",") : [];
console.log(params);
const params = (req.query.params ? req.query.params.split(",") : [])
.map(v=>{
let n = parseInt(v); return n ? n : v
});

const { status, response } = await makeRpc(req.params["rpc"], ...params);
res.status(status).send(response);
} else {
Expand Down

0 comments on commit f41fabc

Please sign in to comment.