Skip to content

Releases: GaneshKandu/SPAs

1.1.0

28 Jun 17:53

Choose a tag to compare

Merge branch 'main' of https://github.com/GaneshKandu/SPAs

SPAs

15 Jun 15:14
b8dbdca

Choose a tag to compare

spa-express

Serve Single Page Application (SPA) builds like React, Angular, or Vue directly using Express.js with zero configuration.

Features

  • Plug-and-play middleware for serving SPA build folders
  • Supports React, Angular, Vue, and other frontend frameworks
  • Simple one-liner setup using Express.js
  • Automatically serves index.html for unknown routes (for client-side routing)

Installation

npm install spa-express

Usage

import express from 'express';
import spa_express from 'spa-express';

const app = express();

// Serve your SPA from the 'dist' directory (can be 'build' for React apps)
app.use(spa_express(app, 'dist'));

app.listen(3000, () => {
  console.log('Server is running on http://localhost:3000');
});

Author

Ganesh Kandu [kanduganesh@gmail.com]