@appgeist/storage example with authentication
An example to demonstrate the usage of @appgeist/storage with authentication.
-
yarn install
ornpm install
-
yarn dev
ornpm run dev
-
Upload files by
POST
ing requests to paths such ashttp://localhost:3000
orhttp://localhost:3000/subfolder/to/store
. In Postman, make sure to:- set Authorization to Bearer Token and set the token to
--DUMMY-TOKEN--
(as specified in auth.js); - set Body type to
form-data
, add a File property withfile
key and select a file to upload.
- set Authorization to Bearer Token and set the token to
-
In Postman, set Authorization to Bearer Token and set the token to
--DUMMY-TOKEN--
and request uploaded files byGET
ting from URLs such ashttp://localhost:3000/ceb88dea-5135-4321-8af8-846e29b7efc4.webp
,http://localhost:3000/assets/ceb88dea-5135-4321-8af8-846e29b7efc4.jpg
,http://localhost:3000/ceb88dea-5135-4321-8af8-846e29b7efc4-w200-h200.webp
,http://localhost:3000/ceb88dea-5135-4321-8af8-846e29b7efc4-w50-h50-lq.jpg
, whereceb88dea-5135-4321-8af8-846e29b7efc4
is the UUID returned by successfully uploading a picture tohttp://localhost:3000
.
See @appgeist/storage README for more info and feel free to inspect the source code.
The ISC License.