Skip to content

Commit

Permalink
fix(swagger-middleware): cant hmr
Browse files Browse the repository at this point in the history
  • Loading branch information
chizukicn committed Oct 19, 2023
1 parent 43e7dbe commit 702a14d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 124 deletions.
3 changes: 2 additions & 1 deletion packages/integrations/swagger-middleware/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export function createSwaggerMiddleware(
app: FourzeApp,
options: SwaggerOptions = {}
): FourzeMiddleware {
return (req, res) => {
return async (req, res) => {
await app.ready();
const routers = createQuery(app.middlewares)
.where((r) => isRouter(r) && r.meta.swagger !== false)
.select((r) => r as FourzeRouter);
Expand Down
122 changes: 0 additions & 122 deletions packages/integrations/swagger-middleware/src/test.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/server/src/hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function createHmrApp(options: FourzeHmrOptions = {}): FourzeHmrApp {
if (fs.existsSync(moduleName)) {
const stat = await fs.promises.stat(moduleName);
if (stat.isDirectory()) {
const files = await glob(fsInclude, { cwd: moduleName });
const files = await glob(fsInclude, { cwd: moduleName, onlyFiles: false, markDirectories: true });
const tasks = files.map((name) => load(join(moduleName, name)));
return await Promise.all(tasks).then((r) => r.some((f) => f));
} else if (stat.isFile()) {
Expand Down

0 comments on commit 702a14d

Please sign in to comment.