rascafr / example-loopback-secure-storage

Loopback example project to demonstrate capabilities of loopback-secure-storage component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

example-loopback-secure-storage

The project is generated by LoopBack.

It is basically a demo for the loopback-secure-storage component developped by the same author.

Instructions

Just clone the repository, then run npm i inside and you're done.

Start the project with npm start, the API explorer webpage will open directly.

Note: The swagger is started at server initialisation for documentation purpose, but you might want to use Postman instead for instance (mostly for createFile and downloadFile), or even Curl! 😎

curl --location --request GET 'http://localhost:3000/api/SecretDocuments/1234/downloadFile' > test.pdf

Project's API

The example shows a container to store PDF in a secure way, using the SecureStorage component with AES-128 encryption.

Available routes:

  • /api/SecretDocuments: will return the list of the stored documents

  • /api/SecretDocuments/createFile will attempt to upload the given file and store it as a encrypted file using the storage.json config file

  • /api/SecretDocuments/{documentId}/downloadFile: will try to download the given document

  • /api/SecretDocuments/{documentId}/deleteFile: will try to delete the stored document and it database entry

I want it!

Great! Then feel free to run npm i loopback-secure-storage in your own project and you're good to go.

You can find additionnal information on the component's GitHub repository

About

Loopback example project to demonstrate capabilities of loopback-secure-storage component


Languages

Language:JavaScript 100.0%