MockAPI-PHP

Environment Variables (.env Configuration)

You can customize various settings by configuring environment variables in the .env file.
A template .env.sample is included in the package.

PORT=3030             # Port number for the mock API server
BASE_PATH=/api        # Base path for the API (e.g., /api/v1)
LOG_DIR=./logs        # Directory for log output
TEMP_DIR=./temp       # Directory for temporary files (e.g., cookies.txt)
TIMEZONE=             # Timezone for logging (default is UTC)
API_KEY=              # API key for authentication (long-term authentication for the application)
CREDENTIAL=           # Credential (temporary token for individual user authentication)

Note: The API_KEY and CREDENTIAL options are implemented as a simple authentication mechanism. If specified, the server will extract the Bearer token from the Authorization header and perform authentication.