'Pass multiple values to a param in getStaticPaths() in nextjs
I want to have two routes
- /midterm/cs611
- /finalterm/cs611
All i am trying to do is when i hit endpoint /midterm/cs611 it should display different content and when it hits to /finalterm/cs611 it should display different content. But i end up with correct results when hitting /finalterm/cs611 and when i hit /midterm/cs611 it shows 404 page.
If i replace like 'midterm' || 'finalterm', i see 404 page for finalterm and correct results for midterm.
Here i have my code
Solution 1:[1]
In your case exam_type is always "finalterm" as you use || (or) operator. It is not going to second option i.e. "midterm". You can see finalterm route because you wrote that first, if you write midterm before finalterm you will see midterm route.
If you want two different routes, then you have to define both the routes separately instead of || (or) operator.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Kumar Saurabh |



