1.8.0 • Published 1 year ago

@cloud-cli/storage v1.8.0

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

File storage service

A file bin service for all your quick and easy storage needs.

API

See api.yaml for API specification.

Usage

With docker

docker pull ghcr.io/cloud-cli/storage:latest
docker run --rm -e ROOT_DIR=/opt/data -e PORT=1234 -v$PWD/data:/opt/data ghcr.io/cloud-cli/storage:latest

See also the release page.

As a standalone server with Node.JS

import start from '@cloud-cli/storage';

start({ rootDir: process.cwd() + '/data', port: 1234 });

As an ES Module

Consuming it as an ES module: if the server is running at https://bin.example.com, import it as a module in a project:

import { createBin, createFile, writeFile, readFile } from 'https://bin.example.com/index.mjs';

async function save(content) {
  const { binId } = await createBin();
  const { fileId } = await createFile(binId);

  return await writeFile(binId, fileId, content);
}

const { binId, fileID, url } = await save('hello');
const content = await readFile(binId, fileId);
// or directly
const hello = await (await fetch(url)).text();

Environment variables

envdescription
ROOT_DIRString. Path to a folder where all data is stored
PORTNumber. HTTP port
1.8.0

1 year ago

1.7.5

1 year ago

1.7.3

1 year ago

1.7.2

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.7.4

1 year ago

1.6.1

1 year ago

1.6.0

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago