Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
loopback-component-storage-swisscom
Advanced tools
Readme
NOTE: The loopback-component-storage module supersedes loopback-storage-service. Please update your package.json accordingly.
LoopBack storage component provides Node.js and REST APIs to manage binary contents using pluggable storage providers, such as local file systems, Amazon S3, or Rackspace cloud files. We use pkgcloud to support the cloud based storage services including:
The binary artifacts are organized with containers and files. A container is the collection of files. Each file will belong to a container.
LoopBack exposes the APIs using a model that is attached to a data source configured with the loopback-component-storage connector.
var ds = loopback.createDataSource({
connector: require('loopback-component-storage'),
provider: 'filesystem',
root: path.join(__dirname, 'storage')
});
var container = ds.createModel('container');
app.model(container);
The following methods are mixed into the model class:
getContainers(cb): List all containers
createContainer(options, cb): Create a new container
destroyContainer(container, cb): Destroy an existing container
getContainer(container, cb): Look up a container by name
uploadStream(container, file, options, cb): Get the stream for uploading
downloadStream(container, file, options, cb): Get the stream for downloading
getFiles(container, download, cb): List all files within the given container
getFile(container, file, cb): Look up a file by name within the given container
removeFile(container, file, cb): Remove a file by name within the given container
upload(req, res, cb): Handle the file upload at the server side
download(container, file, res, cb): Handle the file download at the server side
Each storage provider takes different settings; these details about each specific provider can be found below:
Local File System
{ provider: 'filesystem', root: '/tmp/storage' }
Amazon
{ provider: 'amazon', key: '...', keyId: '...' }
Rackspace
{ provider: 'rackspace', username: '...', apiKey: '...' }
OpenStack
{ provider: 'openstack', username: 'your-user-name', password: 'your-password', authUrl: 'https://your-identity-service' }
Azure
{ provider: 'azure', storageAccount: "test-storage-account", // Name of your storage account storageAccessKey: "test-storage-access-key" // Access key for storage account }
List all containers
Get information about a container by name
Create a new container
Delete an existing container by name
List all files within a given container by name
Get information for a file within a given container by name
Delete a file within a given container by name
Upload one or more files into the given container by name. The request body should use multipart/form-data which the file input type for HTML uses.
Download a file within a given container by name
FAQs
Loopback Storage Service (Swisscom)
The npm package loopback-component-storage-swisscom receives a total of 2 weekly downloads. As such, loopback-component-storage-swisscom popularity was classified as not popular.
We found that loopback-component-storage-swisscom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.