File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { FileSystemRouter } from "bun" ;
2
2
import { NJSON } from "next-json" ;
3
+ import { statSync } from "node:fs" ;
3
4
import { join , relative } from "node:path" ;
4
- import { Suspense } from "react" ;
5
5
import { renderToReadableStream } from "react-dom/server" ;
6
6
7
7
export class StaticRouters {
@@ -117,9 +117,9 @@ export async function serveFromDir(config: {
117
117
for ( const suffix of suffixes ) {
118
118
try {
119
119
const pathWithSuffix = join ( basePath , suffix ) ;
120
- const file = Bun . file ( pathWithSuffix ) ;
121
- if ( await file . exists ( ) ) {
122
- return new Response ( Bun . file ( pathWithSuffix ) ) ;
120
+ const stat = statSync ( pathWithSuffix ) ;
121
+ if ( stat ?. isFile ( ) ) {
122
+ return Bun . file ( pathWithSuffix ) ;
123
123
}
124
124
} catch ( err ) { }
125
125
}
You can’t perform that action at this time.
0 commit comments