adonis-drive-google 💾
Google Cloud Storage driver for AdonisJS Drive
Requirements
- AdonisJS Drive (
adonis install @adonisjs/drive
)
Installation
adonis install adonis-drive-google
Instructions
Make sure to register the provider inside start/app.js
file.
const providers = ... 'adonis-drive-google/providers/DriveProvider'
Add new configuration inside disks
module in config/drive.js
:
gcs: driver: 'gcs' keyFilename: Env // path to json file bucket: Env
Add google cloud storage variables in .env
:
GCS_KEY_FILE_NAME=
GCS_BUCKET=
Examples
Find if a file exists or not.
const isExists = await Drive
Change bucket
You can change bucket at runtime, just passing the bucket name before action.
const isExists = await Drive
Complete example please go to this link
Thanks
Special thanks to the creator(s) of AdonisJS for creating such a great framework.