burger-api 0.0.34 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/core/openapi.d.ts +2 -2
- package/dist/src/core/router.d.ts +1 -1
- package/dist/src/core/router.js +1 -1
- package/dist/src/core/server.js +3 -3
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +8 -8
- package/dist/src/middleware/validator.d.ts +1 -1
- package/dist/src/utils/error.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Router } from "./router";
|
|
2
|
-
import type { ServerOptions } from "../types";
|
|
1
|
+
import type { Router } from "./router.js";
|
|
2
|
+
import type { ServerOptions } from "../types/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Generates an OpenAPI 3.0 document from the router's routes and global options.
|
|
5
5
|
* @param router The router instance with loaded routes.
|
package/dist/src/core/router.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { readdirSync } from "fs";
|
|
3
3
|
import * as path from "path";
|
|
4
4
|
// Import utils
|
|
5
|
-
import { cleanPrefix, normalizePath } from "
|
|
5
|
+
import { cleanPrefix, normalizePath } from "../utils/index.js";
|
|
6
6
|
/**
|
|
7
7
|
* Router class for handling file-based routing.
|
|
8
8
|
* Loads routes from a directory structure and matches requests to the appropriate route handlers.
|
package/dist/src/core/server.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Import stuff from core
|
|
2
|
-
import { HttpRequest } from "./request";
|
|
3
|
-
import { HttpResponse } from "./response";
|
|
2
|
+
import { HttpRequest } from "./request.js";
|
|
3
|
+
import { HttpResponse } from "./response.js";
|
|
4
4
|
// Import stuff from utils
|
|
5
|
-
import { errorResponse } from "
|
|
5
|
+
import { errorResponse } from "../utils/error.js";
|
|
6
6
|
export class Server {
|
|
7
7
|
options;
|
|
8
8
|
server = null;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -27,5 +27,5 @@ export declare class Burger {
|
|
|
27
27
|
*/
|
|
28
28
|
serve(port?: number, cb?: () => void): Promise<void>;
|
|
29
29
|
}
|
|
30
|
-
export { setDir } from "./utils/index";
|
|
31
|
-
export type { ServerOptions, RequestHandler, BurgerRequest, BurgerResponse, Middleware, } from "./types";
|
|
30
|
+
export { setDir } from "./utils/index.js";
|
|
31
|
+
export type { ServerOptions, RequestHandler, BurgerRequest, BurgerResponse, Middleware, } from "./types/index.js";
|
package/dist/src/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Import stuff from core
|
|
2
|
-
import { Server } from "./core/server";
|
|
3
|
-
import { Router } from "./core/router";
|
|
4
|
-
import { HttpRequest } from "./core/request";
|
|
5
|
-
import { HttpResponse } from "./core/response";
|
|
6
|
-
import { generateOpenAPIDocument } from "./core/openapi";
|
|
7
|
-
import { swaggerHtml } from "./core/swagger-ui";
|
|
2
|
+
import { Server } from "./core/server.js";
|
|
3
|
+
import { Router } from "./core/router.js";
|
|
4
|
+
import { HttpRequest } from "./core/request.js";
|
|
5
|
+
import { HttpResponse } from "./core/response.js";
|
|
6
|
+
import { generateOpenAPIDocument } from "./core/openapi.js";
|
|
7
|
+
import { swaggerHtml } from "./core/swagger-ui.js";
|
|
8
8
|
// Import middleware
|
|
9
|
-
import { createValidationMiddleware } from "./middleware/validator";
|
|
9
|
+
import { createValidationMiddleware } from "./middleware/validator.js";
|
|
10
10
|
export class Burger {
|
|
11
11
|
options;
|
|
12
12
|
server;
|
|
@@ -134,4 +134,4 @@ export class Burger {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
// Export utils
|
|
137
|
-
export { setDir } from "./utils/index";
|
|
137
|
+
export { setDir } from "./utils/index.js";
|
package/dist/src/utils/error.js
CHANGED