3.0.0 • Published 7 months ago

@varasto/remote-storage v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@varasto/remote-storage

npm

Storage implementation which retrieves and stores data to an remote server. Uses axios library as it's HTTP client and works both in Node.js and browser environments.

Installation

$ npm install --save @varasto/remote-storage

Usage

npm

The package provies an function called createRemoteStorage which returns an object that is an implementation of Storage type and works as an Varasto HTTP API client.

Basic usage of the API looks like this:

import { createRemoteStorage } from '@varasto/remote-storage';

const storage = createRemoteStorage({ url: 'https://example.com/api/' });

The function takes an configuration object, which supports these settings:

PropertyDefault valueDescription
urlhttp://0.0.0.0:3000URL where the API can be accessed from.
authOptional authentication credentials.

The auth setting, when used, should be a simple object containing username and password properties.

const storage = createRemoteStorage({
  auth: {
    username: 'AzureDiamond',
    password: 'hunter2'
  }
});
3.0.0

7 months ago

2.0.0

7 months ago

1.1.0

3 years ago

1.0.0

3 years ago