Scripts and Migrations
These scripts handle targeted data corrections. They are not part of regular startup or development workflow.
Available Scripts
Section titled “Available Scripts”| Script | Location | Purpose |
|---|---|---|
backfill-images.js | scripts/ | Backfills missing image fields on existing articles |
backfill-images-from-source.js | scripts/ | Fetches and backfills images from original source URLs |
republish-articles.js | root | Re-triggers publish logic for a batch of articles |
Running a Script
Section titled “Running a Script”cd news-server
# Make sure .env is in place and MongoDB is reachablenode scripts/backfill-images.js