Node-Express: how to take query and redirect

Hello, Maybe someone could help. As in the title, how to get query params ans use them to redirect to the proper page? The output is [object Object]

let {query} = req;

Hi @GM_sql

You need to be a little more elaborate in what you are trying to achieve. You are correctly accessing the query parameters. You should be aware that query is an object. Assuming you hit the following endpoint


The query object will look like:

    iso2: 'ca',
    region: 'americas'

You can redirect to another site using the following.


I hope that helps.

The problem is already solved. What I wanted to do was to redirect, as an example, to :


This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.