# yaml
components_manager:
task_processors: # Task processor is an executor for coroutine tasks
main-task-processor: # Make a task processor for CPU-bound coroutine tasks.
worker_threads: 4 # Process tasks in 4 threads.
fs-task-processor: # Make a separate task processor for filesystem bound tasks.
worker_threads: 4
default_task_processor: main-task-processor # Task processor in which components start.
components: # Configuring components that were registered via component_list
server:
listener: # configuring the main listening socket...
port: 8080 # ...to listen on this port and...
task_processor: main-task-processor # ...process incoming requests on this task processor.
logging:
fs-task-processor: fs-task-processor
loggers:
default:
file_path: '@stderr'
level: debug
overflow_behavior: discard # Drop logs if the system is too busy to write them down.
# /// [static config]
# yaml
handler-messages:
path: /v1/messages
method: GET,POST
fs-cache-main:
dir: /var/www/ # Path to the directory with files
update-period: 10s # Update cache each N seconds.
handler-static: # Static Content handler.
fs-cache-component: fs-cache-main
path: /* # Registering handlers '/*' find files.
method: GET # Handle only GET requests.
# /// [static config]
dynamic-config: # Dynamic config storage options
defaults:
USERVER_FILES_CONTENT_TYPE_MAP:
.css: "text/css"
.gif: "image/gif"
.htm: "text/html; charset=utf-8"
.html: "text/html; charset=utf-8"
.jpeg: "image/jpeg"
.js: "application/javascript"
.json: "application/json"
.md: "text/markdown"
.png: "image/png"
.svg: "image/svg+xml"
.ttf: "font/ttf"
.otf: "font/otf"
.woff: "font/woff"
.woff2: "font/woff2"
.eot: "application/vnd.ms-fontobject"