{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Craft Cloud Config File", "type": "object", "required": [ "php-version" ], "properties": { "php-version": { "type": "string", "enum": ["8.1", "8.2", "8.3", "8.4"], "description": "Required. Major and minor PHP version (e.g., '8.2')." }, "node-version": { "type": "string", "pattern": "^\\d+$", "description": "Optional. Major Node.js version (e.g., '18')." }, "node-path": { "type": "string", "description": "Optional. Directory for NPM build commands." }, "npm-script": { "type": "string", "description": "Optional. Name of the script in package.json to run at build time." }, "artifact-path": { "type": "string", "description": "Optional. Directory to be uploaded to CDN after build." }, "app-path": { "type": "string", "description": "Optional. Path where your PHP application lives." }, "webroot": { "type": "string", "description": "Optional. Public directory containing index.php." }, "redirects": { "type": "array", "items": { "type": "object", "required": [ "pattern", "destination" ], "properties": { "pattern": { "oneOf": [ { "type": "string" }, { "type": "object", "properties": { "protocol": { "type": "string" }, "hostname": { "type": "string" }, "pathname": { "type": "string" }, "search": { "type": "string" }, "hash": { "type": "string" } }, "additionalProperties": false } ], "description": "URLPattern-compatible matcher for request URLs." }, "destination": { "type": "string", "description": "URL or template for the redirect target, supporting substitutions like {request.uri}." }, "status": { "type": "integer", "enum": [ 301, 302 ], "description": "Optional HTTP status code (301 for permanent, 302 for temporary)." } }, "additionalProperties": false } }, "rewrites": { "type": "array", "items": { "type": "object", "required": [ "pattern", "destination" ], "properties": { "pattern": { "oneOf": [ { "type": "string" }, { "type": "object", "properties": { "protocol": { "type": "string" }, "hostname": { "type": "string" }, "pathname": { "type": "string" }, "search": { "type": "string" }, "hash": { "type": "string" } }, "additionalProperties": false } ], "description": "URLPattern-compatible matcher for request URLs." }, "destination": { "type": "string", "description": "Internal routing path or target handler." } }, "additionalProperties": false } } }, "additionalProperties": false }