Type object
File match *.uncors.yml *.uncors.yaml .uncors.yml .uncors.yaml
Schema URL https://catalog.lintel.tools/schemas/schemastore/uncors-configuration/latest.json
Source https://raw.githubusercontent.com/evg4b/uncors/main/schema.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Configuration file for uncors reverse proxy

Properties

mappings Mapping[] required

A list of mappings that describe how to forward requests. Ports are specified in the 'from' URL (e.g., http://localhost:8080).

minItems=1
cache-config object

Global cache configuration

3 nested properties
clear-time string

Expired cache clear time

expiration-time string

Cache expiration time

methods Method[]

List of http methods with can be cached

Default:
[
  "GET"
]
debug boolean

Show debug output

Default: false
proxy string

HTTP/HTTPS proxy to provide requests to real server (used system by default)

format=uri

Definitions

Duration string

Duration in human-readable format. Supported units are 'h' (hours), 'm' (minutes), 's' (seconds), 'ms' (milliseconds), 'us' (microseconds), 'ns' (nanoseconds).

Examples:
  • "3s"
  • "1m 30s"
  • "500ms"
  • "1h 30m 15s 500ms 100us 200ns"
FileMockResponse object

Mock response definition based on file content

code integer required

HTTP response status code

Examples: 200, 404, 500
min=100max=599
file string required

Path to the file whose content will be sent in the mock response

delay string

Duration in human-readable format. Supported units are 'h' (hours), 'm' (minutes), 's' (seconds), 'ms' (milliseconds), 'us' (microseconds), 'ns' (nanoseconds).

Examples: "3s", "1m 30s", "500ms", "1h 30m 15s 500ms 100us 200ns"
pattern=^(\d+h)?\s*(\d+m)?\s*(\d+s)?\s*(\d+ms)?\s*(\d+(us|µs))?\s*(\d+(ns))?$
headers Record<string, string>

HTTP headers definition

Headers Record<string, string>

HTTP headers definition

Mapping object | object
Method string
Mock object

Mocked request definition

path string required

Mocked request path

response RawMockResponse | FileMockResponse required

Mock response definition

headers Record<string, string>

HTTP headers definition

method string
Values: "GET" "HEAD" "POST" "PUT" "DELETE" "CONNECT" "OPTIONS" "TRACE" "PATCH"
queries Record<string, string>

HTTP query parameters definition

OptionsHandling object

OPTIONS request handling configuration

disabled boolean

Disable OPTIONS request handling and all requests will be proxied to the target server

Default: false
headers Record<string, string>

HTTP headers definition

status integer

HTTP response status code

Examples: 200, 404, 500
min=100max=599
Queries Record<string, string>

HTTP query parameters definition

RawMockResponse object

Mock response definition based on raw content

code integer required

HTTP response status code

Examples: 200, 404, 500
min=100max=599
raw string required

Content which will be sent in the mock response

delay string

Duration in human-readable format. Supported units are 'h' (hours), 'm' (minutes), 's' (seconds), 'ms' (milliseconds), 'us' (microseconds), 'ns' (nanoseconds).

Examples: "3s", "1m 30s", "500ms", "1h 30m 15s 500ms 100us 200ns"
pattern=^(\d+h)?\s*(\d+m)?\s*(\d+s)?\s*(\d+ms)?\s*(\d+(us|µs))?\s*(\d+(ns))?$
headers Record<string, string>

HTTP headers definition

Rewrite object
from string required
to string required
host string
Script object

Script request handler definition

path string required

Request path to handle with script

file string

Path to script file

headers Record<string, string>

HTTP headers definition

method string
Values: "GET" "HEAD" "POST" "PUT" "DELETE" "CONNECT" "OPTIONS" "TRACE" "PATCH"
queries Record<string, string>

HTTP query parameters definition

script string

Inline script code

StaticDirectory object

Static serving directory definition

dir string required

Path to the folder from which the static files will be served

path string required

Path where the static files will be served

index string

The file witch will be returned if the requested file is not found. It should be a relative path within the dir folder

Default: ""
StatusCode integer

HTTP response status code

Examples:
  • 200
  • 404
  • 500