forEachなどを使ってみませんか
function endPoint (req, res) {
const queriesFound ={}
req.query.forEach(query=>{
queriesFound[query]=query;
}
QueriesFound will be an object
{ “Name”:”Name”, “AnotherParam”:”AnotherParam” }
}
//QueriesFoundはオブジェクトになります
{“ name”:” Name”、“ AnotherParam”:” AnotherParam”}