Deployment: API Server
This guide outlines the process for deploying the API server to a production environment. The server is built with Dart Frog and packaged as a Docker container, making it portable and easy to deploy to any hosting provider that supports Docker.
Pre-Deployment Configuration
Section titled “Pre-Deployment Configuration”Before you can deploy, you must complete two essential configuration steps.
-
Configure Production Environment Variables
In your production environment, you will not use a
.env
file. Instead, you must configure the environment variables directly in your chosen hosting provider’s interface. This is a critical step for security and proper configuration.For a detailed explanation of each required variable, please see the Configure Environment Variables Guide.
-
Configure CORS
For the Web Dashboard to communicate with your API in production, you must correctly configure Cross-Origin Resource Sharing (CORS) by setting the
CORS_ALLOWED_ORIGIN
environment variable.For instructions, see the Configure CORS Guide.
Deployment with Dart Frog
Section titled “Deployment with Dart Frog”Once your configuration is ready, you can proceed with the deployment. The Dart Frog documentation provides comprehensive guides for various hosting providers and deployment strategies (e.g., using Docker, deploying to Google Cloud Run, etc.).
Following the official documentation is the recommended and most reliable path to a successful deployment.