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

The Wiki Stuff! #12

Merged
merged 17 commits into from
May 13, 2018
Merged

The Wiki Stuff! #12

merged 17 commits into from
May 13, 2018

Conversation

moelrobi
Copy link
Member

To Create Wiki Entry's in an Community.

@moelrobi moelrobi added the enhancement New feature or request label Apr 14, 2018
@moelrobi moelrobi added this to the The Blog Update (0.2) milestone Apr 14, 2018
@moelrobi moelrobi self-assigned this Apr 14, 2018
Uploading an Image to the Amino's Server included.
@moelrobi moelrobi changed the title createWiki The Wiki Stuff! Apr 20, 2018
Copy link
Member

@felixfong227 felixfong227 left a 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

@moelrobi
Copy link
Member Author

@felixfong227 but Fetch is only for GET Request or am i wrong?

@felixfong227
Copy link
Member

@moelrobi Nope, fetch can actually perform all kinds of HTTP request, GET/POST/PUT/DELETE you name it.

And in order to send a POST request, the following code might work.

fetch('https://api.someendpoint.com', {
  method: "POST",
  body: JSON.stringify({
    data: true,
    name: 'string',
  }),
});

😉

@moelrobi moelrobi added the MajorUpdate All PR's / Issues that are with the latest major Update. label Apr 22, 2018
@moelrobi
Copy link
Member Author

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.

@felixfong227
Copy link
Member

@moelrobi
But we have to consider our front-end JavaScript user? they can't just pass in a path variable inside a Browser environment, but what they can pass in is an actual file object, and so as the Node users. So what I'm thinking is instead of grabbing the path as an argument, we grab a actual file object?

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);
})();

@felixfong227
Copy link
Member

Hey @moelrobi , to be honest, do we need to consider our front-end user after all lol?

@moelrobi
Copy link
Member Author

moelrobi commented May 7, 2018

@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.)

@akatsukilevi
Copy link
Contributor

It's no need to consider front-ending programming on the Amino.JS backend
And the upload system will be transmitting the upload-item as a object, no need to worry

@felixfong227
Copy link
Member

Got ya @moelrobi @akatsukilevi 😉

@moelrobi
Copy link
Member Author

Not making it Compatible with Browser. Leaving the old Upload Function. 💯

@moelrobi moelrobi merged commit 180bbe3 into blogdev May 13, 2018
@moelrobi moelrobi deleted the feature-createWiki branch May 13, 2018 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request MajorUpdate All PR's / Issues that are with the latest major Update.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants