Created
January 27, 2020 13:28
-
-
Save hubgit/108f94802c085747ea93d136c44bb3e9 to your computer and use it in GitHub Desktop.
Deploy a PHP endpoint to now.sh
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
# Install `now` | |
yarn global add now | |
# Install `jo` | |
brew install jo | |
# Create a new folder for the project | |
mkdir now-php-example && cd $_ | |
# Create now.json | |
jo -p 'functions[api/*.php]/runtime=now-php@0.0.9' > now.json | |
# Create a minimal PHP script in the API folder | |
mkdir api | |
echo -e "<?php\nphpinfo();" > api/test.php | |
# Deploy the project | |
now | |
# open https://{name}.now.sh/api/test in a browser |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment