Deployments: loading...

Files

hook.io provides a Virtual File System API allowing developers to seamlessly work with files from multiple cloud storage providers.

All accounts come with integrated access to our own Built-in virtual file-system. This allows developers to instant store and retrieve files without having to provision or configure any addition providers

Should you want more control over your files and use your storage provider, hook.io provides integrated configuration for all major cloud storage providers

There are three separate ways to use Multi-Cloud Files

Files HTTP API

Simply click on any method name below to visit the REST API endpoint for that File method.

Every URL is a fully qualified self documenting API endpoint, capable of receiving many forms of data.

Supported Cloud File Providers

Inside a Hook Service

Note: This will be scoped to your built-in hook.io Cloud Files container

module['exports'] = function readFile (hook) {
  hook.fs.readFile('testing-file.txt', function(err, res){
    if (err){ 
      return res.end(err.message); 
    }
    hook.res.end(JSON.stringify(res, true, 2));
  });
};
                    
See Forkable Files Examples

You can also use the client SDK API to configure multi-cloud file providers using our own credentials.

Using the Hook.io SDK

var sdk = require("hook.io");

var client = sdk.createClient({ accessKey: 12345 });

client.files.readFile('hello.txt', function (err, file) {
  console.log(err, file);
});
                  

Built-in Virtual File-System

Don't want to provision a new account with one of our supported cloud providers? We've got you covered!

Built into every hook.io account is an integrated virtual file system which allows you to seamlessly manage files using a familiar API

module['exports'] = function readFile (hook) {
  hook.fs.readFile('testing-file.txt', function(err, res){
    if (err){ 
      return res.end(err.message); 
    }
    hook.res.end(JSON.stringify(res, true, 2));
  });
};
                    


Any SFTP / SSH Server

Using the sdk, provide the following configuration

{
  adapter: "sftp",
  host: "yourserver.com",
  port: 22,
  username: "username",
  password: null, // optional, can use private key
  privateKey: require('fs').readFileSync(__dirname + '/../../../../.ssh/id_rsa')
}
                  

Amazon s3

Using the sdk, provide the following configuration

{
  provider: 'amazon',
  adapter: "amazon",
  accessKeyId: 'abcdefg',
  accessKey: '12345',
  region: 'us-east-1'
}
                  

Google

Using the sdk, provide the following configuration

{
  provider: 'google',
  adapter: "google",
  keyFilename: __dirname + '/g.json', // path to a JSON key file
  projectId: 'myProject' // project id
}
                  

Microsoft

Using the sdk, provide the following configuration

{
  adapter: "microsoft",
  provider: 'azure',
  storageAccount: "my_storage_account",         // Name of your storage account
  storageAccessKey: "abcdefgh" // Access key for storage account
}
                  

Rackspace

Using the sdk, provide the following configuration

{
  adapter: 'rackspace', // required
  provider: 'rackspace', // required
  username: 'hookio-vfs', // required
  apiKey: 'abcdefg', // required
  region: 'IAD', // required, regions can be found at
  // http://www.rackspace.com/knowledge_center/article/about-regions
  useInternal: false // optional, use to talk to serviceNet from a Rackspace machine
}