https://github.com/hyper63/storage-update-demo
https://github.com/hyper63/storage-update-demo
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/hyper63/storage-update-demo
- Owner: hyper63
- Created: 2021-01-22T13:41:09.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-22T13:41:30.000Z (about 5 years ago)
- Last Synced: 2025-01-13T05:41:36.614Z (about 1 year ago)
- Language: JavaScript
- Size: 1.34 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hyper63 upload example
This project is used for the hyper63 storage sandbox to demo how to upload a file to hyper63 storage.
```
const FormData = require('form-data')
const fetch = require('fetch')
const s = require('@hyper63/storage-demo')
const url = 'https://play.hyper63.com'
const token = '...'
const form = new FormData()
form.append('file', s, {
type: 'image/jpg',
filename: 'somepicture.jpg'
})
await ( await fetch(`${url}/storage/posters`, {
method: 'POST',
headers: { authorization: `Bearer ${token}` },
body: form
})).json()
```