- Frontend now uses @sveltejs/adapter-static for production builds - Backend serves both API and static files from single port (originally port 3000) - Removed all throw statements from services to avoid Elysia prototype errors - Fixed favicon serving and SvelteKit assets path handling - Added ecosystem.config.js for PM2 process management - Comprehensive deployment documentation (PM2 + HAProxy) - Updated README with single-port architecture - Created start.sh script for easy production start
26 lines
744 B
JavaScript
26 lines
744 B
JavaScript
import adapter from '@sveltejs/adapter-static';
|
|
|
|
/** @type {import('@sveltejs/kit').Config} */
|
|
const config = {
|
|
kit: {
|
|
adapter: adapter({
|
|
pages: 'build',
|
|
assets: 'build',
|
|
fallback: 'index.html',
|
|
precompress: false,
|
|
strict: true
|
|
}),
|
|
// Get app URL from environment or default to localhost
|
|
// This is used for production builds and CSRF configuration
|
|
// Set via VITE_APP_URL environment variable
|
|
// Disable origin checks in dev to prevent issues with browser extensions
|
|
csrf: {
|
|
trustedOrigins: process.env.NODE_ENV === 'production'
|
|
? (process.env.VITE_APP_URL ? [new URL(process.env.VITE_APP_URL).origin] : undefined)
|
|
: ['http://localhost:5173', 'http://127.0.0.1:5173']
|
|
}
|
|
}
|
|
};
|
|
|
|
export default config;
|