Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo for GCS incorrectly uses GCSDataStore #547

Open
dpmillerau opened this issue Jan 8, 2024 · 3 comments
Open

Demo for GCS incorrectly uses GCSDataStore #547

dpmillerau opened this issue Jan 8, 2024 · 3 comments

Comments

@dpmillerau
Copy link

dpmillerau commented Jan 8, 2024

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
Copy link
Author

also EVENTS are wrong too

@fenos
Copy link
Collaborator

fenos commented Jan 8, 2024

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

@dpmillerau
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants