@tinyhttp/app
Advanced tools
Comparing version 0.1.7 to 0.1.9
{ | ||
"name": "@tinyhttp/app", | ||
"version": "0.1.7", | ||
"version": "0.1.9", | ||
"description": "tinyhttp core", | ||
@@ -16,2 +16,5 @@ "homepage": "https://github.com/talentlessguy/tinyhttp", | ||
}, | ||
"scripts": { | ||
"build": "rollup -c" | ||
}, | ||
"keywords": [ | ||
@@ -31,3 +34,3 @@ "tinyhttp", | ||
"dependencies": { | ||
"@tinyhttp/etag": "^0.1.7", | ||
"@tinyhttp/etag": "^0.1.10", | ||
"content-type": "^1.0.4", | ||
@@ -40,5 +43,9 @@ "proxy-addr": "^2.0.6", | ||
"@types/proxy-addr": "^2.0.0", | ||
"@types/range-parser": "^1.2.3" | ||
"@types/range-parser": "^1.2.3", | ||
"@wessberg/rollup-plugin-ts": "^1.2.25", | ||
"rollup": "^2.17.1", | ||
"rollup-plugin-auto-external": "^2.0.0", | ||
"rollup-plugin-terser": "^6.1.0" | ||
}, | ||
"gitHead": "c10093fd4cdbbfa6470f0b200522f79f5c7b068f" | ||
"gitHead": "584a7d9a98e23543ef5285af59532a583c578d11" | ||
} |
@@ -53,16 +53,22 @@ import { createServer } from 'http' | ||
} | ||
get(url: string | Handler, handler?: Handler) { | ||
this.routes.push(createHandler({ url, handler, method: 'GET' })) | ||
return this | ||
} | ||
post(url: string | Handler, handler?: Handler) { | ||
this.routes.push(createHandler({ url, handler, method: 'POST' })) | ||
return this | ||
} | ||
put(url: string | Handler, handler?: Handler) { | ||
this.routes.push(createHandler({ url, handler, method: 'PUT' })) | ||
return this | ||
} | ||
patch(url: string | Handler, handler?: Handler) { | ||
this.routes.push(createHandler({ url, handler, method: 'PATCH' })) | ||
return this | ||
} | ||
head(url: string | Handler, handler?: Handler) { | ||
this.routes.push(createHandler({ url, handler, method: 'HEAD' })) | ||
return this | ||
} | ||
@@ -73,2 +79,3 @@ all(url: string | Handler, handler?: Handler) { | ||
} | ||
return this | ||
} | ||
@@ -79,6 +86,7 @@ use(handler: Handler) { | ||
}) | ||
return this | ||
} | ||
listen( | ||
port: number, | ||
port?: number, | ||
cb = () => console.log(`Started on http://${host}:${port}`), | ||
@@ -89,3 +97,3 @@ host: string = 'localhost', | ||
// @ts-ignore | ||
createServer((req: Request, res: Response) => { | ||
const server = createServer((req: Request, res: Response) => { | ||
/// Define extensions | ||
@@ -144,4 +152,6 @@ | ||
}) | ||
}).listen(port, host, backlog, cb) | ||
}) | ||
return server.listen(port, host, backlog, cb) | ||
} | ||
} |
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
Network access
Supply chain riskThis module accesses the network.
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
24223
9
681
6
1
Updated@tinyhttp/etag@^0.1.10