Next.js Discord

Discord Forum

How to structure Next.js app with both URL redirects and frontend routes?

Unanswered
Largehead hairtail posted this in #help-forum
Open in Discord
Largehead hairtailOP
building a roblox link fixer like fxtwitter or fixupx (add "fix" before roblox.com urls for better discord embeds). need routes like /users/123 to serve meta tags + redirect to respective roblox.com links, but also want a landing page with a link converter. what's the best way to structure this in next.js? main concern is handling both the redirect routes and the frontend routes cleanly

a problem i thought of is if I handled api routes thru a subdomain, the whole point of the project wouldn't make sense (adding fix before links to serve a better embed)

thoughts???

6 Replies

Largehead hairtailOP
example of my project in action
mine (will have proper domain): https://rxblox.vercel.app/users/1517579/profile
I want to maintain this functionality while being able to serve a frontend with react components with nextjs. The project is built so far on express with typescript
Right now I can serve a frontend, but it's limited to plain html css & js, which isn't enough for what I want to add.
Largehead hairtailOP
bump