Tidying up static files
This commit is contained in:
parent
d67ef14ad6
commit
46c71a9857
4 changed files with 12 additions and 102 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
BIN
src/static/mcp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
|
|
@ -169,4 +169,4 @@ class StructuredLogger {
|
|||
export const logger = new StructuredLogger();
|
||||
|
||||
// Re-export for convenience
|
||||
export { LogContext, StructuredLogEntry };
|
||||
export type { LogContext, StructuredLogEntry };
|
||||
Loading…
Reference in a new issue