Skip to content

Download public objects from a gcloud bucket and create a relative Gatsby Source Node.

License

Notifications You must be signed in to change notification settings

edoardofelici/gatsby-source-gcloud-object

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gatsby-source-gcloud-object

Download objects from a gcloud bucket and create a relative Gatsby Source Node.

Note: Current version only supports authenticated google cloud users. You can:

Install

npm install --save gatsby-source-gcloud-object

How to use

Add the following to your gatsby-node.js:

plugins: [
    {
      resolve: 'gatsby-source-gcloud-object',
      options: {
        project: "core-editor-test",
        bucket: "keplercube-core-editor-test",
        prefix: "" //[optional] defaults to nothing (gets all bucket content)
        domain: null,   //[optional] defaults to `storage.googleapis.com`
        protocol: null, //[optionsal] defaults to `https`
      }
    }
]

GraphQL query

export const GCloudObjectsQuery = graphql`
query GCloudObjectsQuery{
  allGCloudObject{
    edges{
      node{
        id
        baseUrl
        bucket
        name
        contentType
        timeCreated
        updated
        md5Hash
        etag
        
        absolutePath
      }
    }
  }
}
`

About

Download public objects from a gcloud bucket and create a relative Gatsby Source Node.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published