feat: Containerize services with Docker Compose (PostgreSQL, Strapi CMS, Express Backend, Nginx Frontend) on custom ports >9000

This commit is contained in:
Vishva
2026-08-03 19:58:10 +05:30
parent 48f8ab9716
commit 6244fd4072
247 changed files with 56672 additions and 169 deletions
+12 -1
View File
@@ -1,17 +1,28 @@
import { Router } from 'express';
import { getContent, updateSection, updateAllContent } from '../db.js';
import { requireAuth } from '../auth.js';
import { getStrapiBlogs } from '../strapi.js';
import seedContent from '../seed/default-content.json' with { type: 'json' };
const VALID_SECTIONS = Object.keys(seedContent);
const router = Router();
router.get('/', (_req, res) => {
router.get('/', async (_req, res) => {
const { content, updatedAt } = getContent();
const strapiItems = await getStrapiBlogs();
if (strapiItems && content.insights) {
content.insights.items = strapiItems;
}
res.json({ ...content, _updatedAt: updatedAt });
});
router.get('/blogs', async (_req, res) => {
const { content } = getContent();
const strapiItems = await getStrapiBlogs();
res.json(strapiItems || content.insights?.items || []);
});
router.put('/', requireAuth, (req, res) => {
const { _updatedAt, ...content } = req.body;
const updatedAt = updateAllContent(content);