This commit is contained in:
Tomas Mirchev 2025-06-29 16:38:04 +00:00
parent fbaf93e426
commit 1bf921a56e
3 changed files with 13 additions and 13 deletions

View File

@ -27,18 +27,6 @@ services:
- app-network - app-network
restart: unless-stopped restart: unless-stopped
static-provider:
image: nginx:alpine
container_name: static-provider
ports:
- "3005:80" # Nginx static files
volumes:
- ./static-files:/static-files
- ./static-provider/nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- app-network
restart: unless-stopped
networks: networks:
app-network: app-network:
driver: bridge driver: bridge

View File

@ -1,7 +1,8 @@
import axios from "axios"; import axios from "axios";
const API_BASE_URL = "https://api.med.tomastm.com"; const API_BASE_URL = "https://api.med.tomastm.com";
const RESOURCES_BASE_URL = "https://resources.med.tomastm.com"; //const RESOURCES_BASE_URL = "https://resources.med.tomastm.com";
const RESOURCES_BASE_URL = "https://api.med.tomastm.com/content";
export const apiInstance = axios.create({ export const apiInstance = axios.create({
baseURL: API_BASE_URL, baseURL: API_BASE_URL,

View File

@ -97,6 +97,17 @@ app.get(
}), }),
); );
// Serve static files with automatic ETag handling
app.use(
"/content",
express.static(STATIC_DIR, {
etag: true, // Enable automatic ETag generation
lastModified: true, // Include Last-Modified header
maxAge: 3600000, // Cache for 1 hour, but always revalidate
immutable: false, // Files can change
}),
);
app.get( app.get(
"/structure", "/structure",
asyncHandler(async (req, res) => { asyncHandler(async (req, res) => {