Created
November 9, 2015 17:02
-
-
Save anovikov1984/eca243f0b0c0c74770a3 to your computer and use it in GitHub Desktop.
Fetching environment variables and generating a JSON response using them
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: application/json'); | |
$publishKey = trim(getenv("PUBNUB_PUBLISH_KEY")); | |
$subscribeKey = trim(getenv("PUBNUB_SUBLISH_KEY")); | |
if (empty($publishKey)) { | |
$publishKey = "demo"; | |
} | |
if (empty($subscribeKey)) { | |
$subscribeKey = "demo"; | |
} | |
echo '{"publish_key": "' . $publishKey . '", "subscribe_key": "' . $subscribeKey . '"}'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment