Clone the gcp-image-upload repository
Open the terminal and navigate to clonned project.
Install the dependencies using npm i
.
Download the key file from your GCP account using below steps.
- Go to your GCP console or here.
- Choose the project which you have created.
- Then navigate to IAM and Admin option in the sidebar and select Service Accounts options.
- Then click on the More icon at the end of your project and select Create Key.
- Select as JSON click create. This will create the key and the JSON file will be downloaded in the browser.
- Run
npm start
command to start the server.
- projectId - This can be fetched from the downloaded key file.
- bucket - Go to GCP and select the storage from the side menu. This will display all the storage buckets with their name.
Try calling the upload API and find the iuploaded file in the GCP storage engine.