Go/React Azure Storage Frontend

React

This app uses React for the frontend, which allows you to upload a file, and then use the Fine Uploader API to upload the file to Azure. To install all dependencies:

yarn or npm i

Go

This app uses Go for the backend, which is responsible for creating signed urls to access the Azure Storage Service. To install all dependencies:

go get ./...

Environment


Do one of the following to set the necessary environment variables:

Set environement vars locally

  • REACT_APP_SAS_CONTAINER
  • REACT_APP_SAS_SERVICE
  • SAS_SERVICE
  • SAS_PASSWORD.

Use .env files

  1. Create a .env.local file in the root directory
  2. Create a .env file in the api/ directory
  3. Write the following in .env.local:
REACT_APP_SAS_SERVICE=(my service name)
REACT_APP_SAS_CONTAINER=(my container name)
  1. Write the following in api/.env
SAS_CONTAINER=(my contianer name)
SAS_PASSWORD=(my access key)

Run

  1. Build the react app: yarn build or npm run build
  2. Run the react app: npx serve -s build
  3. Build the go server: cd api && go build
  4. Run the go server: ./api