Comparing version 2.0.48 to 2.0.49
@@ -5,2 +5,3 @@ /// <reference types="node" /> | ||
import { BridgeRoutes } from '../../routes'; | ||
declare const logs: any[]; | ||
export declare const createHttpHandler: (routes: BridgeRoutes, config?: { | ||
@@ -11,2 +12,3 @@ errorHandler?: ErrorHandler; | ||
}) => (req: IncomingMessage, res: ServerResponse) => Promise<ServerResponse<IncomingMessage>>; | ||
export {}; | ||
//# sourceMappingURL=node-http.d.ts.map |
@@ -6,2 +6,3 @@ "use strict"; | ||
const routes_1 = require("../../routes"); | ||
const logs = []; | ||
const createHttpHandler = (routes, config) => { | ||
@@ -17,2 +18,4 @@ let path; | ||
[path, queryString] = (req.url || '/').split('?'); | ||
if (path === 'get-logs') | ||
return res.writeHead(200, { 'Content-Type': 'application/json' }).end(JSON.stringify(logs)); | ||
const route = serverRoutes[path]; | ||
@@ -36,3 +39,3 @@ const endpoint = route?.[req.method]; | ||
if (config?.logs) | ||
console.log({ | ||
logs.push({ | ||
path, | ||
@@ -39,0 +42,0 @@ body, |
{ | ||
"name": "bridge", | ||
"version": "2.0.48", | ||
"version": "2.0.49", | ||
"description": "Bridge is a Typescript Node.js framework that provides an easy and scalable way to create REST APIs while generating the client code.", | ||
@@ -5,0 +5,0 @@ "author": "Bridge Team <support@bridge.codes>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
111550
1219