question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to start keystone in a sub-path in embedded next.js app?

See original GitHub issue

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 to mydomain.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

screenshot

Contextual informations

  • I’m using keystone embedded nextjs app
  • nextjs app run on mydomain.it and I would like to start keystone app on mydomain.it/admin instead of repeating it on mydomain.it and this is why the eaddrinuse error
  • node v18.12.1 + chrome@latest

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
TheRealFlyingCodercommented, Dec 1, 2022

@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.

1reaction
riccardi1997commented, Nov 30, 2022

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to embed Keystone + SQLite in a Next.js app
In this tutorial, we're going to show you how to embed Keystone and an SQLite database into a Next.js app. By the end,...
Read more >
Issues · keystonejs/keystone - GitHub
The most powerful headless CMS for Node.js — built with GraphQL and React - Issues ... How to start keystone in a sub-path...
Read more >
Base Path - next.config.js
To deploy a Next.js application under a sub-path of a domain you can use the ... For example, to use /docs instead of...
Read more >
How do I embed next.js with material-ui into keystonejs?
I'm trying to embed nextjs with material-ui into keystonejs. I can get keystone to play nice with nextjs, ...
Read more >
Build A Website with Keystone Next And Next.js | by Hussain Arif
Configure your database; Set up your back-end; Code your fields and their corresponding schemas for your GraphQL API; Later, build the query and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found