Skip to content

Commit dba9b95

Browse files
fix(cli): improve serve error handling output
Keep serve UX consistent when docs directory is missing or server fails. Signed-off-by: night-slayer18 <samanuaia257@gmail.com>
1 parent df564c7 commit dba9b95

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/cli/src/commands/serve.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function registerServe(program: Command): void {
3838
app.use(express.default.static(docsDir));
3939

4040
// SPA fallback - serve index.html for all routes (for React Router)
41-
app.get('*', (_req: import('express').Request, res: import('express').Response) => {
41+
app.get(/(.*)/, (_req: import('express').Request, res: import('express').Response) => {
4242
res.sendFile(path.join(docsDir, 'index.html'), (err: unknown) => {
4343
if (err) {
4444
res.status(404).send('Documentation not found. Run: autodocs build');

0 commit comments

Comments
 (0)