mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-11 14:00:29 +00:00
fix: Resolve UI loading issues for v3.1.2
- Add explicit SPA route handler in server/index.js - Correct middleware order in server/index.js - Build CSS locally and copy into Docker image - Adjust Dockerfile to copy pre-built CSS
This commit is contained in:
+1
-1
@@ -28,4 +28,4 @@ EXPOSE 7655
|
||||
|
||||
# Define the command to run the app using the start script from root package.json
|
||||
# This script should handle changing into the server directory
|
||||
CMD [ "npm", "run", "start" ]
|
||||
CMD [ "npm", "run", "start" ]
|
||||
+2
-2
@@ -6,8 +6,8 @@
|
||||
"scripts": {
|
||||
"start": "cd server && node index.js",
|
||||
"dev:server": "NODE_ENV=development node -r dotenv/config --env-file=.env server/index.js",
|
||||
"dev:css": "tailwindcss -c ./src/tailwind.config.js -i ./src/index.css -o ./src/public/output.css --watch",
|
||||
"build:css": "tailwindcss -c ./src/tailwind.config.js -i ./src/index.css -o ./src/public/output.css --minify",
|
||||
"dev:css": "./node_modules/.bin/tailwindcss -c ./src/tailwind.config.js -i ./src/index.css -o ./src/public/output.css --watch",
|
||||
"build:css": "./node_modules/.bin/tailwindcss -c ./src/tailwind.config.js -i ./src/index.css -o ./src/public/output.css --minify",
|
||||
"dev": "concurrently \"npm:dev:server\" \"npm:dev:css\"",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
|
||||
+9
-1
@@ -444,7 +444,15 @@ const app = express();
|
||||
// Middleware
|
||||
app.use(cors());
|
||||
app.use(express.json());
|
||||
app.use(express.static(path.join(__dirname, '../src/public')));
|
||||
|
||||
// Serve static files FIRST
|
||||
app.use(express.static(path.join(__dirname, '../public')));
|
||||
|
||||
// Handle SPA routing: always serve index.html for non-API GET requests
|
||||
// This should come AFTER static middleware
|
||||
app.get(/^(?!\/api).*/, (req, res) => {
|
||||
res.sendFile(path.join(__dirname, '../public', 'index.html'));
|
||||
});
|
||||
|
||||
// Allow iframe embedding
|
||||
app.use((req, res, next) => {
|
||||
|
||||
+1
-1994
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user