Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website demo – support HTTP uploads #1024

Merged
merged 3 commits into from
Nov 18, 2023
Merged

Website demo – support HTTP uploads #1024

merged 3 commits into from
Nov 18, 2023

Conversation

gilest
Copy link
Collaborator

@gilest gilest commented Nov 18, 2023

This will be useful for debugging issues and testing new features.

Users being able to interactively explore this addon should help them understand and visualise the less-documented functionality like queue flushing.

UI

image

Example HTTP upload

image

Copy link

cloudflare-workers-and-pages bot commented Nov 18, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b877c72
Status: ✅  Deploy successful!
Preview URL: https://9e405945.ember-file-upload.pages.dev
Branch Preview URL: https://docs-upload-options.ember-file-upload.pages.dev

View logs

Comment on lines 25 to 31
const DEFAULT_URL = 'https://api.bytescale.com/v1/files/basic';
const METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'HEAD'];
const DEFAULT_METHOD = 'POST';
const DEFAULT_HEADERS = {
Authorization: 'Basic YXBpa2V5OmZyZWU',
'Content-Type': 'application/x-www-form-urlencoded',
};
Copy link
Collaborator Author

@gilest gilest Nov 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While looking for a public "black hole" upload endpoint I found this documented in the MIT npm package react-uploader README

And it worked for me 🙃

I also read the terms that this company publishes and there's nothing referencing public API endpoints really...

This is a suggestion that a visitor may want to use. When doing so they are using this API on their own behalf 🤷🏻

Copy link
Collaborator Author

@gilest gilest Nov 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ended up replacing this with a WireMock endpoint from a free account I created. It doesn't behave as much like a real upload endpoint, but it does work

@gilest gilest merged commit 2ed61b7 into master Nov 18, 2023
15 checks passed
@gilest gilest deleted the docs/upload-options branch November 18, 2023 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant