Static file serving for Electron apps with SPA routing support and custom protocol handling.
electron-serve is a utility library that provides static file serving for Electron applications. It solves the problem of loading single-page applications in Electron by serving files through a custom protocol and enabling proper client-side routing with fallback to index.html for non-existent routes.
Electron developers building single-page applications who need proper routing support and custom protocol handling for their desktop apps.
Developers choose electron-serve because it provides a simple, focused solution to Electron's SPA loading limitations, supports modern JavaScript features like ES modules out of the box, and offers flexible configuration for custom protocols and multiple window scenarios.
Static file serving for Electron apps
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enables seamless client-side routing by serving index.html for non-existent routes, making it compatible with React Router and Vue Router out of the box.
Serves ES modules with correct MIME types and supports source maps for debugging minified code in DevTools, requiring no extra configuration.
Allows serving files through custom schemes like app://-, avoiding file:// URL limitations and enabling multiple window setups with unique schemes.
Provides a simple, single-function API focused on Electron's SPA loading problem without bloat, as seen in the straightforward serve() and loadURL() usage.
Due to the custom protocol, relative require() calls for Node.js modules fail, forcing developers to use script tags or bundlers instead.
Only serves static files without dynamic content handling, requiring separate solutions for API calls or server-side rendering in Electron apps.
Setting up custom schemes, partitions, and multiple windows adds complexity compared to basic file:// loading, especially for simple single-window apps.