
Add Environment Variables
April 9, 2025About 2 min
Add Environment Variables 관련
How to Build a Multilingual Social Recipe Application with Flutter and Strapi
Hey there! In this project, you will build a multilingual social recipe application using Flutter and Strapi. Flutter is an open-source UI software development kit created by Google. It allows you to build beautiful and highly interactive user interf...
How to Build a Multilingual Social Recipe Application with Flutter and Strapi
Hey there! In this project, you will build a multilingual social recipe application using Flutter and Strapi. Flutter is an open-source UI software development kit created by Google. It allows you to build beautiful and highly interactive user interf...
You will store configuration data such as API keys, environment-specific URLs (base URL, recipe endpoints, comments endpoints), and other sensitive or configurable data outside your codebase using the flutter_dotenv
package you installed earlier. Create an .env
file in your root directory and add your environment variables:
BASE_URL=your-base-url
USERS_ENDPOINT=/auth/local
USERS_ENDPOINT_REG=/auth/local/register
ACCESS_TOKEN=your-api-key
RECIPE_ENDPOINT=/recipes
COMMENT_ENDPOINT=/comments
R_REQUEST_ENDPOINT=/recipe-requests
BASE_URL
: This is the base URL for your Strapi backend server. The/api
means that all API endpoints are accessed via this base path. This URL is used to construct full URLs for all API requests by appending specific endpoints to it.USERS_ENDPOINT
: This endpoint typically handles login operations where existing users authenticate by submitting their credentials.USERS_ENDPOINT_REG
: This is the registration endpoint for new users.ACCESS_TOKEN
: This is the API token you created earlier which is used for authenticating API requests.RECIPE_ENDPOINT
: This endpoint is used to fetch a list of recipes or a single recipe. You can also use it to post new recipes, or update or delete a recipe.COMMENT_ENDPOINT
: This endpoint manages comments related to recipes.R_REQUEST_ENDPOINT
: This endpoint manages requests related to recipes.