Environment Variables
This documentation explains environment variables within the Hostless provider application. Environment variables are key-value pairs that store configuration settings or sensitive information used by your application during execution. Hostless allows you to manage environment variables for your applications, providing a secure and centralized way to control these settings.
Accessing Environment Variables
Hostless typically offers two primary ways to access environment variables for your application:
- Hostless Interface: The Hostless user interface provides a dedicated section for viewing and managing environment variables associated with your application. This allows you to see a list of defined variables, their values, and potentially edit them.
- Application Code: Your application code can access environment variables using the mechanisms provided by your programming language or framework. The specific syntax and methods for accessing environment variables will vary depending on your chosen language.
Updating Environment Variables
Hostless allows you to update environment variables through the user interface. Here's a general overview of the process:
- Access Environment Variables: Locate the section within Hostless dedicated to environment variables for your application.
- View Variables: This section typically displays a list of currently defined environment variables and their values.
- Edit Variable: Select a specific variable you want to modify.
- Update Value: Enter the new value for the chosen environment variable.
- Save Changes: Save the modifications to the environment variable.
Importing from a .env File:
- Prepare .env File: Create a file named .env in the root directory of your application code. This file should contain lines in the format KEY=VALUE, where KEY is the environment variable name and VALUE is its corresponding value.
- Upload: Hostless offers functionalities to upload your .env file
- Import Variables: Initiate the import process to read the environment variables from the .env file and inject them into your Hostless environment.
Please Note: Changes to environment variables will redeploy the latest stable version of your application for the new values to take effect.