server
- Type:
RsdoctorServerConfig - Optional:
true - Default:
{}
Configure the Rsdoctor report server.
port
- Type:
number - Optional:
true - Default:
random(3000, 8999)
Configure the port for the Rsdoctor report server.
If server.port is not set, Rsdoctor uses the top-level port option. If both options are set, server.port takes priority.
cors
- Type:
boolean | RsdoctorServerCorsOptions - Optional:
true - Default: Allows local origins only.
Configure CORS response headers for the Rsdoctor report server.
By default, Rsdoctor allows local origins only:
http://localhostandhttps://localhostlocalhostsubdomains, such ashttp://foo.localhosthttp://127.0.0.1andhttps://127.0.0.1http://[::1]andhttps://[::1]
All default local origins can include any port.
Values
false: Disable the CORS middleware.true: Use the defaults from thecorspackage.object: Pass options to thecorsmiddleware. Iforiginis omitted, Rsdoctor keeps the default local-origin policy. Iforiginis set, it replaces the default local-origin policy.
Rsdoctor still validates local request hosts separately. The cors option only controls CORS middleware behavior and response headers.
Examples
Allow a custom origin:
Keep the default local-origin policy and add other CORS options:
Use the cors package defaults:

