Next.js Discord

Discord Forum

Render and deploy several pages only

Answered
Mud-daubers posted this in #help-forum
Open in Discord
Avatar
Mud-daubersOP
Hi, I have several pages in my next js app (under /src/app). But now, the case is I have to separately deploy each of the route.

Is there a way to do this aside from isolate the page i want to display to a separate branch?
Is it possible to create a config file to select only the desired pages to be rendered?

Thank you
Answered by Yacare Caiman
you can disable page by putting _ (underscore) in front of page folder name example /src/app/_PageA/page.tsx/.jsx
View full answer

7 Replies

Avatar
Yacare Caiman
can you epxlain bit more ? i am assuming that you have already created many pages in nextjs which are working perfectly and now you dont want to display some of the page pages right? is this true?
Avatar
@Yacare Caiman can you epxlain bit more ? i am assuming that you have already created many pages in nextjs which are working perfectly and now you dont want to display some of the page pages right? is this true?
Avatar
Mud-daubersOP
For example I have 3 pages
- page A
- page B
- page C

I have to deploy page A to VM 1, page B to VM 2, and page C to VM 3. So I need a way to only render and deploy one page only.

Yes all the pages are working fine and I want to display some pages only. But currently I'm searching for a way to do this without having to isolate each page as a separate app.
Avatar
Yacare Caiman
Before i directly jump to solution can i see your project directory ?
Avatar
@Yacare Caiman Before i directly jump to solution can i see your project directory ?
Avatar
Mud-daubersOP
its actually a private repo. But i put each page in /src/app directory
Avatar
Yacare Caiman
alright since you want each page on diffrent vm which is not directly possible from single app project, to workaround this you can create 3 copies of each project and disabling the other two page which you dont need and deploy 1 by 1 on each vm!
Avatar
Yacare Caiman
you can disable page by putting _ (underscore) in front of page folder name example /src/app/_PageA/page.tsx/.jsx
Answer
Avatar
Mud-daubersOP
ok thanks a lot!