Integrating Custom Server (Express) with Next.js Standalone + Electron #75283
Unanswered
wlaughs
asked this question in
App Router
Replies: 1 comment
-
Hey, you can use this for example - https://github.com/spa5k/GreenDome/, here I'm running a hono server, I believe you can try something like this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I’m using this repo: nextjs_approuter_electron as the foundation for a Next.js + Electron project. My goal is to integrate a custom server (using Express) into this setup.
Here’s what I want to achieve:
Use the Next.js standalone mode while keeping its routing intact but control the server with Express.
Utilize the custom server to define API endpoints and middleware.
Ensure this setup works seamlessly within Electron (e.g., connecting it with main.js or preload scripts).
Tech Stack:
Next.js (standalone mode, App Router)
Express
Electron
What I’ve Tried So Far:
I’ve reviewed the Next.js standalone mode documentation and understand that it outputs a minimal server structure. However, I’m unsure how to:
Properly handle routing and static assets (e.g., _next/static) in a custom server.
Set up Express within this standalone architecture.
Ensure that everything works correctly in both development and production environments.
Any guidance, examples, or insights would be greatly appreciated!
Thanks in advance! 🙏
Beta Was this translation helpful? Give feedback.
All reactions