Tidying up static files

This commit is contained in:
Jerome 2025-07-10 11:17:11 +01:00
commit 46c71a9857
No known key found for this signature in database
4 changed files with 12 additions and 102 deletions

View file

@ -72,7 +72,7 @@ export async function handleSSEConnection(req: Request, res: Response) {
logger.info('Listening on Redis channel', {
sessionId: transport.sessionId,
channel: redisChannel
channel: redisChannelForSession(transport.sessionId)
});
await mcpServer.connect(transport);
}

View file

@ -2,6 +2,8 @@ import { BearerAuthMiddlewareOptions, requireBearerAuth } from "@modelcontextpro
import { AuthRouterOptions, mcpAuthRouter } from "@modelcontextprotocol/sdk/server/auth/router.js";
import cors from "cors";
import express from "express";
import path from "path";
import { fileURLToPath } from "url";
import { EverythingAuthProvider } from "./auth/provider.js";
import { BASE_URI, PORT } from "./config.js";
import { authContext } from "./handlers/common.js";
@ -13,6 +15,10 @@ import { logger } from "./utils/logger.js";
const app = express();
// Get the directory of the current module
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Base security middleware - applied to all routes
const baseSecurityHeaders = (req: express.Request, res: express.Response, next: express.NextFunction) => {
// Basic security headers
@ -150,7 +156,8 @@ app.delete("/mcp", cors(corsOptions), bearerAuth, authContext, handleStreamableH
// Static assets
app.get("/mcp-logo.png", (req, res) => {
res.sendFile("mcp.png", { root: "." });
const logoPath = path.join(__dirname, "static", "mcp.png");
res.sendFile(logoPath);
});
// Upstream auth routes

BIN
src/static/mcp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View file

@ -169,4 +169,4 @@ class StructuredLogger {
export const logger = new StructuredLogger();
// Re-export for convenience
export { LogContext, StructuredLogEntry };
export type { LogContext, StructuredLogEntry };