navidocs/serve-dist.mjs
Claude ea32676df9
Update component files and add serve script
- Update App.vue and CameraModule.vue with testing updates
- Update package.json with test dependencies
- Add serve-dist.mjs for local testing
2025-11-14 15:45:26 +00:00

21 lines
573 B
JavaScript

import express from 'express';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const app = express();
const PORT = 8083;
const distPath = path.join(__dirname, 'client', 'dist');
// Serve static files
app.use(express.static(distPath));
// For SPA, fallback to index.html
app.get('/*', (req, res) => {
res.sendFile(path.join(distPath, 'index.html'));
});
app.listen(PORT, () => {
console.log(`Server listening on http://localhost:${PORT}`);
console.log(`Serving from: ${distPath}`);
});