@codeinkit/http-trigger
Advanced tools
+1
-1
| { | ||
| "name": "@codeinkit/http-trigger", | ||
| "version": "1.0.2", | ||
| "version": "1.0.3", | ||
| "description": "A basic TypeScript project", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
+6
-4
@@ -32,3 +32,5 @@ import fs from 'fs'; | ||
| private flows: Flows; | ||
| private routes: { [key: string]: string } = {}; | ||
| private routes: { [key: string]: string } = { | ||
| 'not-found': 'not-found' | ||
| }; | ||
| private corsOptions: CorsOptions; | ||
@@ -262,3 +264,3 @@ private staticPath?: string; | ||
| if (!match) { | ||
| if (!match && req.method === 'GET') { | ||
| req.url = '/index.html'; | ||
@@ -269,7 +271,7 @@ this.serveStaticFile(req, res); | ||
| const { route, params } = match; | ||
| const { route, params } = match || { route: 'not-found', params: {} }; | ||
| const query = Object.fromEntries(url.searchParams); | ||
| const result = await this.flows.execute(this.routes[route] || 'not-found', { params, query, headers: req.headers }, {...this.unsafe, req, res}).catch((err: HttpError) => { | ||
| const result = await this.flows.execute(this.routes[route], { params, query, headers: req.headers }, {...this.unsafe, req, res}).catch((err: HttpError) => { | ||
| log(err); | ||
@@ -276,0 +278,0 @@ return { |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
40837
0.21%672
0.3%