tus-node-server icon indicating copy to clipboard operation
tus-node-server copied to clipboard

Demo for GCS incorrectly uses GCSDataStore

Open dpmillerau opened this issue 1 year ago • 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'), }) }, ....

dpmillerau avatar Jan 08 '24 03:01 dpmillerau

also EVENTS are wrong too

dpmillerau avatar Jan 08 '24 04:01 dpmillerau

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

fenos avatar Jan 08 '24 09:01 fenos

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.

dpmillerau avatar Jan 08 '24 21:01 dpmillerau