Files
moments/ui/vite.config.ts
rob thijssen 88ce993df3 feat(blog): add markdown blog sourced from a gitea repo
posts are markdown files with yaml frontmatter (title, slug, date;
optional draft/public) in the grenade/blog repo. the worker's new
BlogSource polls the repo — one branch-tip request when nothing
changed — and upserts posts into events with source='blog' and
occurred_at from the frontmatter date, so imported posts keep their
original publish dates and backfill the contribution graph.

- new /v1/blog and /v1/blog/{slug} endpoints over the existing
  EventReader port; drafts stay hidden via the public gate
- new /blog and /blog/:slug routes, nav link, activity-feed entry
  with post icon and filter toggle; relative image srcs resolve to
  gitea raw urls
- shared Markdown component extracted from ProjectPage
- vite proxy target overridable via API_PROXY_TARGET for local dev

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 22:44:56 +03:00

20 lines
639 B
TypeScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
// In dev, the UI is served by Vite at :5173 and proxies `/api/*` to the
// moments-api binary at :8080 (default). In prod, nginx serves the static
// build and reverse-proxies the same `/api/*` to the API backend, so the
// frontend's URL shape is identical in both environments.
export default defineConfig({
plugins: [react()],
server: {
proxy: {
'/api': {
target: process.env.API_PROXY_TARGET ?? 'http://localhost:8080',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},
});