Data

App Config File JSON Example

Application configuration JSON example for backend apps with database, server, auth, feature flags, and logging settings. Copy-ready for Node.js and other backends.

{
  "app": {
    "name": "jsonkit-api",
    "version": "2.1.0",
    "env": "production",
    "port": 8080,
    "baseUrl": "https://api.jsonkit.in",
    "timezone": "UTC"
  },
  "database": {
    "host": "db.internal",
    "port": 5432,
    "name": "jsonkit_prod",
    "pool": {
      "min": 5,
      "max": 20,
      "idleTimeoutMs": 30000
    },
    "ssl": true
  },
  "cache": {
    "provider": "redis",
    "host": "cache.internal",
    "port": 6379,
    "ttlSeconds": 300,
    "prefix": "jk:"
  },
  "auth": {
    "jwtSecret": "{{JWT_SECRET}}",
    "accessTokenTtlSeconds": 900,
    "refreshTokenTtlDays": 30,
    "bcryptRounds": 12
  },
  "features": {
    "betaEditor": false,
    "aiSuggestions": true,
    "maintenanceMode": false,
    "maxFileSizeMb": 10
  },
  "logging": {
    "level": "info",
    "format": "json",
    "destinations": [
      "console",
      "datadog"
    ]
  },
  "rateLimit": {
    "windowMs": 60000,
    "maxRequests": 100,
    "skipSuccessfulRequests": false
  }
}

Field Reference

app.envstringrequiredRuntime environment: development, staging, production. Branch all env-specific behaviour on this field.
database.poolobjectoptionalConnection pool settings. min/max control concurrency — too low = slow, too high = DB connection exhaustion.
auth.jwtSecretstringrequiredUse a placeholder like {{JWT_SECRET}} in committed config. Inject the real value via environment variables at runtime.
featuresobjectoptionalFeature flags that toggle product behaviour without a code deploy.
rateLimit.windowMsintegeroptionalRate limit sliding window in milliseconds. 60000 = 1-minute window.

Variants

DevelopmentRelaxed settings for local development — no SSL, debug logging, long token TTL.
Development
{
  "app": {
    "env": "development",
    "port": 3000,
    "baseUrl": "http://localhost:3000"
  },
  "database": {
    "host": "localhost",
    "port": 5432,
    "name": "jsonkit_dev",
    "ssl": false
  },
  "auth": {
    "accessTokenTtlSeconds": 86400,
    "bcryptRounds": 4
  },
  "features": {
    "betaEditor": true,
    "maintenanceMode": false
  },
  "logging": {
    "level": "debug",
    "format": "pretty"
  }
}

Common Use Cases

  • config.json loaded at application startup, overridden by environment variables
  • Feature flag file deployed to change product behaviour without a release
  • Infrastructure-as-code (Terraform, CloudFormation) variable input template
configsettingsbackendfeature flagsNode.js

Validate or format this JSON

Paste the example above into JSONKit's tools to validate, minify, or explore the structure interactively.

Frequently Asked Questions

Never. Use placeholder values like {{JWT_SECRET}} or a separate config.example.json file. Inject real secrets at runtime via environment variables, AWS Secrets Manager, or Vault. Add config.json to .gitignore.

Use a config file for flags that change rarely and require a deploy anyway. Use a database or a dedicated service (LaunchDarkly, Unleash) for flags that need runtime changes — gradual rollouts, A/B tests, or kill switches in production.

JSON is universal and has no parser dependencies. YAML allows comments and is more readable for deeply nested configs. TOML is great for flat configs (like Cargo.toml). Use whatever your runtime and tooling natively support best.

Related JSON Examples