Zack-Dx / Mini-TODO

A repository to contribute at hacktoberfest 2022. Make sure to share love by giving it a star🌟. Have a great day!
https://blueberry-keep.netlify.app/
36 stars 56 forks source link

Added note sharing through Pastebin #154

Open theGeekyLad opened 2 years ago

theGeekyLad commented 2 years ago

Pastebin Integration

Using the Pastebin API, notes can now be easily shared with a direct URL. Here's what it looks like:

mini-todo-pastebin

Setup

You'll need a Pastebin API Developer Key, which can be setup entirely for free on the Pastebin API website, for this to work. The key string can be pasted as the value of the pastebinDevKey constant on the first line of the index.js file.

Circumventing CORS

The server environment that hosts the website must support CORS for the Pastebin API to work or, alternatively, Google Chrome (and similarly other browsers) can be launched with the --disable-web-security flag as follows:

google-chrome --disable-web-security --user-data-dir=0 (on Linux)

Where the '0' at the end can either be left as is, or be made to point to the data directory for another user.

theGeekyLad commented 2 years ago

I've updated the branch and merged all commits. Please let me know if it's alright.

Zack-Dx commented 2 years ago

@theGeekyLad I think the share functionality isn't working can u please check again.

theGeekyLad commented 1 year ago

@Zack-Dx the share functionality only works in a deployed environment as the API calls need to go from an https-based site to the Pastebin API without which we get the CORS error.

Momentarily, for testing, you could launch Chrome with the --disable-web-security flag as follows, to test the functionality: google-chrome --disable-web-security --user-data-dir=0