@jackabox good writeup! glad to find another fellow dev using Laravel and Nuxt. How would you do a redirect in nuxt for:
On production: domain.com -> domain.com/join On dev: Don't redirect from homepage( domain.com) to domain.com/join
Hey, sorry for the delay.
I'd look into the use of env variables here. Where you get the redirects in the middleware, we can do something like this..
const prodRedirects= require('../data/redirectsProd.json') let redirects = require('../data/redirects.json') if (process.env.NODE_ENV === 'production') { redirects = [...prodRedirects, ...redirects] }
This was a pretty quick example but would probably be the way I'd go
@jackabox good example, thank you!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
@jackabox good writeup! glad to find another fellow dev using Laravel and Nuxt. How would you do a redirect in nuxt for:
On production:
domain.com -> domain.com/join
On dev:
Don't redirect from homepage( domain.com) to domain.com/join
Hey, sorry for the delay.
I'd look into the use of env variables here. Where you get the redirects in the middleware, we can do something like this..
This was a pretty quick example but would probably be the way I'd go
@jackabox good example, thank you!