Skip to content

Commit

Permalink
breaking: Remove secondary exports of cli-server-api (#2584)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntie authored Jan 27, 2025
1 parent dbcbfb7 commit 5c2764f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions packages/cli-server-api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ import createDebuggerProxyEndpoint from './websocket/createDebuggerProxyEndpoint
import createMessageSocketEndpoint from './websocket/createMessageSocketEndpoint';
import createEventsSocketEndpoint from './websocket/createEventsSocketEndpoint';

export {devToolsMiddleware};
export {indexPageMiddleware};
export {openStackFrameInEditorMiddleware};
export {openURLMiddleware};
export {rawBodyMiddleware};
export {securityHeadersMiddleware};
export {statusPageMiddleware};
export {systraceProfileMiddleware};

type MiddlewareOptions = {
host?: string;
watchFolders: ReadonlyArray<string>;
Expand All @@ -49,6 +40,7 @@ export function createDevServerMiddleware(options: MiddlewareOptions) {
// @ts-ignore compression and connect types mismatch
.use(compression())
.use(nocache())
.use('/', indexPageMiddleware)
.use('/debugger-ui', debuggerUIMiddleware())
.use(
'/launch-js-devtools',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-server-api/src/indexPageMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function indexPageMiddleware(
res: http.ServerResponse,
next: (err?: any) => void,
) {
if (req.url === '/') {
if (req.method === 'GET' && req.url === '/') {
res.setHeader('Content-Type', 'text/html');
res.end(fs.readFileSync(path.join(__dirname, 'index.html')));
} else {
Expand Down

0 comments on commit 5c2764f

Please sign in to comment.