Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tinyhttp/app

Package Overview
Dependencies
Maintainers
1
Versions
305
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinyhttp/app - npm Package Compare versions

Comparing version 0.1.7 to 0.1.9

dist/index.d.ts

15

package.json
{
"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)
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc