Skip to content

How to have multiple queries in NodeJS #4096

Answered by styfle
luandro asked this question in General
Discussion options

You must be logged in to vote

Try creating a file /api/[firstname]/[lastname].js to create multiple path segments.

Another alternative is to create a file without path segments, such as /api/handle-name.js, and then add a now.json file with rewrites like the following:

{
  "rewrites": [
    { "source": "/v1/:first/:last", "destination": "/api/handle-name" }
  ]
}

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@luandro
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by mcsdevv
Comment options

You must be logged in to vote
2 replies
@FernandoKGA
Comment options

@styfle
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants