dev-env only pages
Unanswered
Transvaal lion posted this in #help-forum
Transvaal lionOP
Hello, I'm building an app (nextjs, app router) for an admin who knows how to code, and how to run an app locally
For some actions (setting up the admin/managers accounts for each new instances of the app, some stats, and whatever else in the future), I was thinking about making him some dev only pages, no auth needed for anything.
That way, he can simply vercel env pull (or for intranet deployment simply use the env from his deployement), do whatever he wants, using those pages.
all the pages would be in src/app/dev/...
A. I have two main options in my mind, make a src/app/dev/layout.tsx, that check if
B. I could simply use a prebuild script that simply rimraf src/app/dev before building
For A, I was wondering if there is still the risk of something leaking if I'm not carefull (like partial stuff loading anyway before the layout blocking the request)? (mostly out of curiosity, I probably won't do that as it looks like a useless risk to take, and additional build time for no reasons)
For B, I was wondering if it was the way to go, or if there is another way ? (looks fine to me, but I feel like there is a better way, even if I can't point out any problem with the solution off the top of my head)
For some actions (setting up the admin/managers accounts for each new instances of the app, some stats, and whatever else in the future), I was thinking about making him some dev only pages, no auth needed for anything.
That way, he can simply vercel env pull (or for intranet deployment simply use the env from his deployement), do whatever he wants, using those pages.
all the pages would be in src/app/dev/...
A. I have two main options in my mind, make a src/app/dev/layout.tsx, that check if
env.NODE_ENV !== "development", and notFound() when neededB. I could simply use a prebuild script that simply rimraf src/app/dev before building
For A, I was wondering if there is still the risk of something leaking if I'm not carefull (like partial stuff loading anyway before the layout blocking the request)? (mostly out of curiosity, I probably won't do that as it looks like a useless risk to take, and additional build time for no reasons)
For B, I was wondering if it was the way to go, or if there is another way ? (looks fine to me, but I feel like there is a better way, even if I can't point out any problem with the solution off the top of my head)