Skip to content

Commit 7998b72

Browse files
committed
Revert "Refactor server.js to improve export structure"
This reverts commit 15ed587.
1 parent 8d1537c commit 7998b72

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

server.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,17 @@ const syntaxErrorTestMarker = ;
158158
// integration test's InMemoryTransport) never binds a real port. Tests set
159159
// NODE_ENV=test before importing server.js.
160160
if (process.env.NODE_ENV !== "test" && !process.env.VERCEL) {
161+
app.listen(PORT, () => {
162+
console.log(`madmcp-server v2.1.0 listening on port ${PORT}`);
163+
...
164+
});
165+
}
166+
167+
// Default export so Vercel's Node runtime can invoke this as a serverless
168+
// function handler (Express apps are callable as (req, res) => {}). Named
169+
// exports are kept for tests/other tooling that import { app, mcpServer }.
170+
export default app;
171+
export { app, mcpServer };
161172
app.listen(PORT, () => {
162173
console.log(`madmcp-server v2.1.0 listening on port ${PORT}`);
163174
if (!GITHUB_TOKEN) console.warn("WARNING: GITHUB_TOKEN is not set.");
@@ -172,8 +183,4 @@ if (process.env.NODE_ENV !== "test" && !process.env.VERCEL) {
172183
});
173184
}
174185

175-
// Default export so Vercel's Node runtime can invoke this as a serverless
176-
// function handler (Express apps are callable as (req, res) => {}). Named
177-
// exports are kept for tests/other tooling that import { app, mcpServer }.
178-
export default app;
179186
export { app, mcpServer };

0 commit comments

Comments
 (0)