tus/tus-node-server

Demo for GCS incorrectly uses GCSDataStore

Opened this issue · 3 comments

line 8 and 14 of demo/server.js incorrectly use GCSDataStore instead of GCSStore
AAnd the whole API call is wrong the the code fails

My Fix

const {Server, EVENTS} = require('@tus/server')
const {GCSStore} = require('@tus/gcs-store')
const {S3Store} = require('@tus/s3-store')
const {FileStore} = require('@tus/file-store')
const {Storage} = require('@google-cloud/storage')

const stores = {
GCSDataStore: () => {
const storage = new Storage( {keyFilename: path.resolve(__dirname, '../keyfile.json')})
return new GCSStore({
bucket: storage.bucket('tus-node-server'),
})
},
....

also EVENTS are wrong too

fenos commented

@dpmillerau are you able to file a PR with the fix?

For the Events, I haven't worked on that bit, I was trying to reproduce a problem with GCSStore. I just noticed it when nothing got logged.