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

@compas/server

Package Overview
Dependencies
Maintainers
1
Versions
196
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@compas/server - npm Package Compare versions

Comparing version 0.0.183 to 0.0.184

6

package.json
{
"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

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