-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to start keystone in a sub-path in embedded next.js app? #8136
Comments
To clarify, are you trying to run 2 separate Next.js apps, where the domain root is your "public site" for example, and everything inside /admin is keystone? |
I'm running a keystonejs embedded nextjs app as in this repository I would like to run the nextjs app in my "public site" and the keystonejs app inside /admin. Is there a way or I have to install two separate project, one for "public site" and another one for /admin? |
Hi everyone, in my opinion I detected the problem! Look at this article: https://keystonejs.com/blog/embedded-mode-with-sqlite-nextjs#add-keystone-to-next-js-config In the article above, it's explained how to build an embedded app, but the withKeystone funcion should be modified because in this version (embedded) in my opinion the withKeystone that starts the keystone app should run under a sub-path. What do you think about it? Is it possible to plan this update or similar? |
Being able to set a sub-path under withKeystone would be really nice. I'm also using Next.js with Keystone and want the Admin UI under "/admin" and the main app under "/index". |
Hey guys, look here: Here we create the AdminUI server and we could create server on a sub-path instead @dcousens what do you think about it? |
@riccardi1997 do you want to run two servers or one server? If you want a separate API server (Keystone) and a separate Next.js frontent, you would have to run them in two separate servers (eg. If you are going to be running a single server (embedded Keystone in a Next.js server), then currently there is no way built in way to set Admin UI to Worth mentioning that with the work we have planned for the roadmap, you will be able to serve the Admin UI homepage from any path you want in the near future but it is not possible at the moment. |
@flexdinesh that was why I asked my original question, they are running two applications haha I'm setting up my environment with the route proxy atm and it is the best solution for a number of reasons, including flexible scaling, split deployments etc etc. Your end-users won't notice the diference and it'll take a lot of complexity out of the solution. It does push you towards the setup of a Monorepo environment though and there are still a few known issues with in Keystone. |
I need to work a little bit. Keep open this issue please, I'll give you a feedback as soon as possible. Thanks guys @flexdinesh @TheRealFlyingCoder UPDATE: Only one question. How can I map the keystone app to mydomain.it/admin? Because my apps start on mydomain.it but in two different ports and I understand that reverse proxy is for mapping the keystone app to mydomain.it/admin for example, right? |
Hey guys! I've almost done.
I can't understand why if I search Obviously I can't find the page cause of the wrong rewrite rule, but is there someone can help me with the rewrite rules? I would to search UPDATES: Look here for a complete configuration https://steveholgado.com/nginx-for-nextjs/#adding-our-nginx-configuration |
This is from an old nginx conf I had. I don't use it anymore but it might help. Try this.
|
Hi @flexdinesh after a lot of tests in my opinion I have an issue with Prisma Client and my connection string to db. And after dockerized my full app this is my connection string: I mapped the container port on 3306 but independently I use localhost or any other hostname as asdfondi_default (that is the network created from container) it doesn't work. It's strange so I started to think there is an issue with PrismaClient as showed. Thanks |
I don't think prisma client is the issue. Perhaps you could try to ssh into your docker container and see if you could ping the mysql server to check if the connection url works. |
+1 on getting keystone to run on a custom route. Im building a portfolio website and using keystone for backend and react for my frontend. Im trying to integrate |
How to reproduce the problem
How can I start keystone app on sub-folder instead of root? For example I have
mydomain.it
with next.js app and I would like to map keystone app tomydomain.it/admin
. I'm using ExtendExpressApp in keystone config but it works after the server started and I need to work before the server starts. Is there another way?What I'm expecting
I'm expecting to start keystone app to
mydomain.it/admin
to avoid an eaddrinuse error as below.Screenshot
Contextual informations
The text was updated successfully, but these errors were encountered: