Update blog seeding to always sync existing articles with new content
Modify server/seed.ts to update existing articles based on slug, and clean up old manual update operations. Update replit.md to reflect new seed behavior. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 23852c00-4779-460a-9e0c-d09fee4b6c92 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 561c9efd-9a81-4252-9d4d-1da2e39baee2 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/23852c00-4779-460a-9e0c-d09fee4b6c92/H1wOZyV Replit-Helium-Checkpoint-Created: true
This commit is contained in:
@@ -26,6 +26,13 @@ The official website for Folx Music Television (folx.tv). Dark-themed bento grid
|
||||
- `articles`: id (serial), title, slug (unique), excerpt, content (HTML), coverImage, category, author, featured, views, publishedAt
|
||||
- `article_views`: id (serial), articleId, ipHash (sha256 truncated to 16 chars), viewedAt — tracks unique IP views per article
|
||||
|
||||
## Seed Behavior
|
||||
- `server/seed.ts` runs on startup and **always syncs** article content from seedArticles array to the database
|
||||
- Existing articles (matched by slug) are **fully updated** with latest title, excerpt, content, coverImage, category, author, featured, publishedAt
|
||||
- New articles are inserted; articles not in seed list are deleted
|
||||
- HTML entity „/“ in title/excerpt are auto-replaced with „/" after seeding
|
||||
- Any changes to article content in seed.ts will be reflected on next deployment
|
||||
|
||||
## API Endpoints
|
||||
- `GET /api/articles` - All articles
|
||||
- `GET /api/articles/featured` - Featured articles
|
||||
|
||||
Reference in New Issue
Block a user