Platform

Environment Variables

6min

Setting up Environment Variables on Parse

Introduction

In this guide, you will learn how to configure Environment variables.

Goal

  • Learn how to set and use Environment Variables page.

Prerequisites

There are no pre-requisites to read or edit this page.

Environment Variables

They are variables that describes your environment. While constants cannot be reassigned during the execution, an Environment Variables may change.

One of the most popular Environment Variable is PATH which contains path to the folders that might contain the executables.

In a few words, an environment variable consists of a name / value pair and any number can be created and available for reference at any given time.

Here at Back4App, this block looks like:

Document image


How to use it?

In this section, we are going to show you how to set an Environment Variable and use it on our Cloud Code.

The first step, what you need to is to access Server Settings > Environment Variables > Settings and set environment variables using KEY=VALUE format. Please, put each variable in one line. Something like the example below:

1 NODE_ENV=PRODUCTION

To use it on your Cloud Code, you can test it following the guide below:

Parse Server 3.X
Parse Server 2.X
main.js


To test it, you can use API Console to call this Cloud Code function and test it.