@compas/server
Advanced tools
Comparing version 0.0.183 to 0.0.184
{ | ||
"name": "@compas/server", | ||
"version": "0.0.183", | ||
"version": "0.0.184", | ||
"description": "Koa server and common middleware", | ||
@@ -18,4 +18,4 @@ "main": "./index.js", | ||
"dependencies": { | ||
"@compas/stdlib": "0.0.183", | ||
"@types/formidable": "2.0.3", | ||
"@compas/stdlib": "0.0.184", | ||
"@types/formidable": "2.0.4", | ||
"@types/koa": "2.13.4", | ||
@@ -22,0 +22,0 @@ "co-body": "6.1.0", |
@@ -6,9 +6,13 @@ /** | ||
* @typedef {object} GetAppOptions | ||
* @property {boolean|undefined} [proxy] Trust proxy headers | ||
* @property {boolean|undefined} [disableHeaders] Don't handle cors headers | ||
* @property {boolean|undefined} [proxy] Trust proxy headers, defaults to true in | ||
* production. | ||
* @property {boolean|undefined} [disableHeaders] Skip CORS and Strict Transport Security | ||
* headers. | ||
* @property {boolean|undefined} [disableHealthRoute] Disable GET /_health | ||
* @property {ErrorHandlerOptions|undefined} [errorOptions] Flexible error handling | ||
* options | ||
* @property {HeaderOptions|undefined} [headers] Argument for defaultHeader middleware | ||
* @property {import("./middleware/log.js").LogOptions|undefined} [logOptions] | ||
* @property {HeaderOptions|undefined} [headers] Argument for defaultHeader middleware. | ||
* Can only be completely disabled by setting `disableHeaders`. | ||
* @property {import("./middleware/log.js").LogOptions|undefined} [logOptions] Pass | ||
* custom log options to the log middleware. | ||
*/ | ||
@@ -31,3 +35,3 @@ /** | ||
* @typedef {object} HeaderOptions | ||
* @property {CorsOptions|undefined} [cors] | ||
* @property {CorsOptions|undefined} [cors] CORS options, defaults to empty object. | ||
*/ | ||
@@ -50,9 +54,5 @@ /** | ||
* - Health check route on `/_health` | ||
* | ||
* - Log middleware to add the Logger from @compas/stdlib on `ctx.log` | ||
* | ||
* - Error handler to catch any errors thrown by route handlers | ||
* | ||
* - A 404 handler when no response is set by other middleware | ||
* | ||
* - Default headers to respond to things like CORS requests | ||
@@ -71,7 +71,9 @@ * | ||
/** | ||
* Trust proxy headers | ||
* Trust proxy headers, defaults to true in | ||
* production. | ||
*/ | ||
proxy?: boolean | undefined; | ||
/** | ||
* Don't handle cors headers | ||
* Skip CORS and Strict Transport Security | ||
* headers. | ||
*/ | ||
@@ -89,5 +91,10 @@ disableHeaders?: boolean | undefined; | ||
/** | ||
* Argument for defaultHeader middleware | ||
* Argument for defaultHeader middleware. | ||
* Can only be completely disabled by setting `disableHeaders`. | ||
*/ | ||
headers?: HeaderOptions | undefined; | ||
/** | ||
* Pass | ||
* custom log options to the log middleware. | ||
*/ | ||
logOptions?: import("./middleware/log.js").LogOptions | undefined; | ||
@@ -116,2 +123,5 @@ }; | ||
export type HeaderOptions = { | ||
/** | ||
* CORS options, defaults to empty object. | ||
*/ | ||
cors?: CorsOptions | undefined; | ||
@@ -118,0 +128,0 @@ }; |
@@ -17,9 +17,13 @@ import { isProduction } from "@compas/stdlib"; | ||
* @typedef {object} GetAppOptions | ||
* @property {boolean|undefined} [proxy] Trust proxy headers | ||
* @property {boolean|undefined} [disableHeaders] Don't handle cors headers | ||
* @property {boolean|undefined} [proxy] Trust proxy headers, defaults to true in | ||
* production. | ||
* @property {boolean|undefined} [disableHeaders] Skip CORS and Strict Transport Security | ||
* headers. | ||
* @property {boolean|undefined} [disableHealthRoute] Disable GET /_health | ||
* @property {ErrorHandlerOptions|undefined} [errorOptions] Flexible error handling | ||
* options | ||
* @property {HeaderOptions|undefined} [headers] Argument for defaultHeader middleware | ||
* @property {import("./middleware/log.js").LogOptions|undefined} [logOptions] | ||
* @property {HeaderOptions|undefined} [headers] Argument for defaultHeader middleware. | ||
* Can only be completely disabled by setting `disableHeaders`. | ||
* @property {import("./middleware/log.js").LogOptions|undefined} [logOptions] Pass | ||
* custom log options to the log middleware. | ||
*/ | ||
@@ -44,3 +48,3 @@ | ||
* @typedef {object} HeaderOptions | ||
* @property {CorsOptions|undefined} [cors] | ||
* @property {CorsOptions|undefined} [cors] CORS options, defaults to empty object. | ||
*/ | ||
@@ -65,9 +69,5 @@ | ||
* - Health check route on `/_health` | ||
* | ||
* - Log middleware to add the Logger from @compas/stdlib on `ctx.log` | ||
* | ||
* - Error handler to catch any errors thrown by route handlers | ||
* | ||
* - A 404 handler when no response is set by other middleware | ||
* | ||
* - Default headers to respond to things like CORS requests | ||
@@ -74,0 +74,0 @@ * |
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
45754
1203
+ Added@compas/stdlib@0.0.184(transitive)
+ Added@types/formidable@2.0.4(transitive)
+ Added@types/node@17.0.14(transitive)
+ Addeddotenv@16.0.0(transitive)
+ Addedpino@7.6.5(transitive)
- Removed@compas/stdlib@0.0.183(transitive)
- Removed@types/formidable@2.0.3(transitive)
- Removed@types/node@17.0.10(transitive)
- Removeddotenv@14.2.0(transitive)
- Removedpino@7.6.4(transitive)
Updated@compas/stdlib@0.0.184
Updated@types/formidable@2.0.4