This backend is deployed in serverless functions by Vercel. api/
folder contains all of the serverless functions. lib/
folder contains all of the process and also used in debugging.
- Google Cloud Storage Bucket: Bucket used to store blobs in Google Cloud Storage
- Google Cloud Service Account: Service account which binds to Google Cloud Storage
- (Optional) base64 encoded Service Account JSON key
- Install the dependencies
go mod tidy
- Create new
.env.development
file in the root directory
# .env.development
GOOGLE_APPLICATION_CREDENTIALS= # location of service-account.json
GCLOUD_BUCKET= # bucket name
GOOGLE_CREDENTIALS_BASE64= # base64 string encoded of service-account.json file
GOOGLE_CREDENTIALS_BASE64
is mandatory in production.
3. Run the server (development)
go run lib/main.go
In case you want to build the application and run the executable, you might use the following command
go build -o bin/server lib/main.go
./bin/server