This is where all of the server-side code for this project will live.
- If you are on Cloud Shell, skip to step 3
- Install Cloud SDK
- Download it:
wget -O gcloud.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-298.0.0-linux-x86_64.tar.gz
- Unzip it:
tar -xzvf gcloud.tar.gz
- Install it:
./google-cloud-sdk/install.sh
- Close your terminal and open a new one.
- Initialize it:
gcloud init
- Install the App Engine component:
gcloud components install app-engine-java
- Install the Cloud Firestore emulator:
gcloud components install cloud-firestore-emulator
- Log in to create application default credentials:
gcloud auth application-default login
- Download it:
- (First time only) run
install.sh
- Run
run.sh
run.sh
will assume that your server is running atlocalhost:8080
. if you are running on Cloud Shell, then you cannot access the website atlocalhost:8080
. you can get around this by setting theDOMAIN
environment variable to the address of your Cloud Shell web preview instance, but keep in mind that this address will change frequently.
- Q: Why do I have to log in using
gcloud
? - A: The server retrieves secrets, such as the Spotify API client secret, using the Secret Manager. You need to either be running on Google Cloud, or be authenticated, in order to access the secrets.
- Q: How do I add a new secret?
- A: Go to the Secret Manager, click Go to Console, and then click "Create Secret".
- Q: How do I change the port where the server runs?
- A: Set the
PORT
environment variable. Keep in mind that you will need to change theDOMAIN
environment variable too, if you do this. And if you don't run the server on port 8080, then you will also have to reconfigure the client dev server if you are interested in using it.