-
Notifications
You must be signed in to change notification settings - Fork 5
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
The Wiki Stuff! #12
The Wiki Stuff! #12
Conversation
Uploading an Image to the Amino's Server included.
Old Repo Names were Contained there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the module isomorphic-fetch
instead of request-promise
. The reason is to make AminoJS both Node and Browser compatible
@felixfong227 but Fetch is only for GET Request or am i wrong? |
@moelrobi Nope, fetch can actually perform all kinds of HTTP request, And in order to send a fetch('https://api.someendpoint.com', {
method: "POST",
body: JSON.stringify({
data: true,
name: 'string',
}),
}); 😉 |
Having a Problem that restricts me from switching to the new API Module. You can't pipe Streams. I tried but it will not work. Uploading is essential and needed for continuing. Until Patched this PR is begin stopped. |
@moelrobi Font end JS <input id="file" type="file" />
<script>
document.querySelector('#id').onchange = (e) => {
const file = e.target.files[0];
AminoJS.upload(file);
};
</script> Node: import fs from 'fs-promise';
(async function(){
const file = await fs.readFile(path);
AminoJS.upload(file);
})(); |
Hey @moelrobi , to be honest, do we need to consider our front-end user after all lol? |
@felixfong227 we didnt plan to develop AminoJS for a Frontend User, you just wanted it to be both compatible. Electron works with Node Require but there it would be good for a file Object to be transmiting for upload, but i dont know how to do that. See Discord for more Infomation (will Private Message you later this day.) |
It's no need to consider front-ending programming on the Amino.JS backend |
Got ya @moelrobi @akatsukilevi 😉 |
Not making it Compatible with Browser. Leaving the old Upload Function. 💯 |
To Create Wiki Entry's in an Community.