@tinyhttp/app
Advanced tools
Comparing version 0.1.23 to 0.1.24
{ | ||
"name": "@tinyhttp/app", | ||
"version": "0.1.23", | ||
"description": "tinyhttp core", | ||
"homepage": "https://github.com/talentlessguy/tinyhttp", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/talentlessguy/tinyhttp.git", | ||
"directory": "packages/app" | ||
}, | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"module": "dist/index.esm.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"engines": { | ||
"node": ">=12.4.0" | ||
}, | ||
"keywords": [ | ||
"tinyhttp", | ||
"node.js", | ||
"web framework", | ||
"web", | ||
"backend" | ||
], | ||
"author": "v1rtl", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@tinyhttp/cookie": "^0.0.6", | ||
"@tinyhttp/cookie-signature": "^0.0.4", | ||
"@tinyhttp/etag": "^0.1.15", | ||
"content-type": "^1.0.4", | ||
"encodeurl": "^1.0.2", | ||
"mime": "^2.4.6", | ||
"proxy-addr": "^2.0.6", | ||
"range-parser": "^1.2.1", | ||
"regexparam": "^1.3.0" | ||
}, | ||
"devDependencies": { | ||
"@types/content-type": "^1.1.3", | ||
"@types/encodeurl": "^1.0.0", | ||
"@types/mime": "^2.0.2", | ||
"@types/proxy-addr": "^2.0.0", | ||
"@types/range-parser": "^1.2.3" | ||
} | ||
"name": "@tinyhttp/app", | ||
"version": "0.1.24", | ||
"description": "tinyhttp core", | ||
"homepage": "https://github.com/talentlessguy/tinyhttp", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/talentlessguy/tinyhttp.git", | ||
"directory": "packages/app" | ||
}, | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"module": "dist/index.esm.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"engines": { | ||
"node": ">=12.4.0" | ||
}, | ||
"keywords": [ | ||
"tinyhttp", | ||
"node.js", | ||
"web framework", | ||
"web", | ||
"backend" | ||
], | ||
"author": "v1rtl", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@tinyhttp/cookie": "workspace:^0.0.6", | ||
"@tinyhttp/cookie-signature": "workspace:^0.0.4", | ||
"@tinyhttp/etag": "^0.1.15", | ||
"content-type": "^1.0.4", | ||
"encodeurl": "^1.0.2", | ||
"mime": "^2.4.6", | ||
"proxy-addr": "^2.0.6", | ||
"range-parser": "^1.2.1", | ||
"regexparam": "^1.3.0" | ||
}, | ||
"devDependencies": { | ||
"@types/content-type": "^1.1.3", | ||
"@types/encodeurl": "^1.0.0", | ||
"@types/mime": "^2.0.2", | ||
"@types/proxy-addr": "^2.0.0", | ||
"@types/range-parser": "^1.2.3" | ||
} | ||
} |
@@ -5,6 +5,4 @@ ![Twitter](https://img.shields.io/twitter/follow/v1rtl.svg?label=sub%20to%20twitter&style=flat-square) ![npm type definitions](https://img.shields.io/npm/types/@tinyhttp/app?style=flat-square) | ||
# @tinyhttp/core | ||
# tinyhttp | ||
`tinyhttp` core module with `App`, `Request` and `Response` classes. | ||
> ⚠ The project is incomplete. Please don't use in production. | ||
@@ -16,3 +14,3 @@ | ||
Node.js 13 is required. | ||
Node.js 12.4.0 or newer (according to https://node.green/#ES2019) is required. | ||
@@ -50,29 +48,12 @@ ```sh | ||
app.all('/', (req, res) => { | ||
res.status(200).send(` | ||
<h1>tinyhttp example</h1> | ||
<ul> | ||
<li>Protocol: ${req.protocol}</li> | ||
<li>HTTPS: ${req.secure ? 'yes' : 'no'}</li> | ||
<li>URL: ${req.url}</li> | ||
<li>Method: ${req.method}</li> | ||
<li>Host: ${req.hostname}</li> | ||
<li>Status: ${res.statusCode}</li> | ||
</ul> | ||
<h2>Request headers</h2> | ||
<pre> | ||
${JSON.stringify(req.headers, null, 2)} | ||
</pre> | ||
`) | ||
}) | ||
app.get('/:first/:second', (req, res) => { | ||
res.json({ URLParams: req.params, QueryParams: req.query }) | ||
}) | ||
app.use(staticFolder()) | ||
app.use(logger()) | ||
app.listen(3000) | ||
app | ||
.get('/', (_, res) => { | ||
res.send('<h1>Hello World</h1>') | ||
}) | ||
.get('/page/:page/', (req, res) => { | ||
res.status(200).send(`${JSON.stringify(req.params, null, 2)}`) | ||
}) | ||
.use(logger()) | ||
.use(staticFolder()) | ||
.listen(3000) | ||
``` |
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
17928
5
57
- Removed@tinyhttp/cookie@0.0.6(transitive)
- Removed@tinyhttp/cookie-signature@0.0.4(transitive)