IR
irwinrodriguez.dev
Back to docs

Configuration

FoxServer configuration is stored in JSON files per project. WinFx can generate and edit them visually; you can also edit them directly.

Configuration file location

Each project has its own file at:

C:\Program Files\FoxServer\config\servers\{projectname}.json

Complete example

{
  "name": "salesapi",
  "description": "Sales management REST API",
  "type": "api",
  "active": true,
  "host": "0.0.0.0",
  "port": 8080,
  "prefix": "/api/v1",
  "issecure": false,
  "dllpath": "C:\\projects\\salesapi\\build\\Interop.salesapi.dll",
  "allowedorigins": "https://myapp.com",
  "allowedmethods": "GET,POST,PUT,DELETE,OPTIONS",
  "allowedheaders": "Content-Type,Authorization",
  "middleware": {
    "auth": {
      "enabled": true,
      "type": "jwt",
      "secret": "your-256-bit-secret-base64",
      "tokenexpirationseconds": 3600,
      "loginendpoint": "auth/login"
    },
    "logging": {
      "enabled": true,
      "path": "C:\\logs\\salesapi\\",
      "fileprefix": "salesapi",
      "format": "Detailed",
      "options": {
        "requests": true,
        "responses": true,
        "errors": true,
        "debug": false,
        "performance": true
      }
    }
  }
}

Server properties

PropertyTypeDefaultDescription
name String Unique project/server identifier
description String "" Human-readable description
type String api "api" for REST APIs, "web" for serving static files
active Boolean false Whether the server loads on FoxServer startup
host String 127.0.0.1 Bind address. 0.0.0.0 accepts all interfaces
port Number 8080 HTTP listening port
prefix String "" URL path prefix (e.g. "/api/v1")
issecure Boolean false Enable HTTPS/SSL
dllpath String Path to the compiled Interop DLL file (required)
publicdir String "" Static files directory (type: web only)

CORS

Configure allowed origins, methods and headers for cross-domain requests:

{
  "allowedorigins": "https://app.example.com,https://admin.example.com",
  "allowedmethods": "GET,POST,PUT,DELETE,OPTIONS",
  "allowedheaders": "Content-Type,Authorization,X-Requested-With"
}
PropertyTypeDefaultDescription
allowedoriginsString*Allowed domains separated by comma, or "*" for any
allowedmethodsStringGET,POST,PUT,DELETE,OPTIONSHTTP methods allowed from the browser
allowedheadersStringContent-Type,AuthorizationHeaders the client can send
In production, always specify exact domains instead of "*" for better security.

HTTPS / SSL

To enable HTTPS you need a certificate in .pfx or .p12 format:

{
  "issecure": true,
  "certificatename": "mycert.pfx",
  "certificatepassword": "your-cert-password"
}
Never include certificate passwords in version control. Use environment variables or a secret manager.

Logging

Configure the server logging system:

PropertyTypeDefaultDescription
enabledBooleanfalseEnable / disable logging
pathStringDirectory where log files are written (must exist)
fileprefixStringfoxserverFile name prefix. Result: "{prefix}_2026-04-11.log"
formatStringSimple"Simple" (one line), "Detailed" (full info), "JSON"
options.requestsBooleantrueLog incoming requests
options.responsesBooleantrueLog outgoing responses
options.errorsBooleantrueLog errors
options.debugBooleanfalseLog debug messages (more verbose)
options.performanceBooleanfalseLog response times per endpoint

Next: Routing →