c7f4db3973
npm run dev now proxies /api to https://upbeatbytes.com so the dev frontend works standalone. Override with GOODNEWS_DEV_API=http://127.0.0.1:8000 to test a local backend. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
14 lines
546 B
JavaScript
14 lines
546 B
JavaScript
import { sveltekit } from '@sveltejs/kit/vite';
|
|
|
|
// Dev API target. Defaults to the live API so `npm run dev` works on its own
|
|
// (no local backend to run). To test LOCAL backend changes, start a host API
|
|
// (`goodnews serve --port 8000`) and run:
|
|
// GOODNEWS_DEV_API=http://127.0.0.1:8000 npm run dev
|
|
const API = process.env.GOODNEWS_DEV_API || 'https://upbeatbytes.com';
|
|
const proxy = { target: API, changeOrigin: true, secure: true };
|
|
|
|
export default {
|
|
plugins: [sveltekit()],
|
|
server: { proxy: { '/api': proxy, '/healthz': proxy } },
|
|
};
|