Skip to content

Added note sharing through Pastebin#154

Open
theGeekyLad wants to merge 9 commits into
Zack-Dx:masterfrom
theGeekyLad:feature/note-sharing
Open

Added note sharing through Pastebin#154
theGeekyLad wants to merge 9 commits into
Zack-Dx:masterfrom
theGeekyLad:feature/note-sharing

Conversation

@theGeekyLad

@theGeekyLad theGeekyLad commented Oct 31, 2022

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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

@Zack-Dx

Zack-Dx commented Nov 6, 2022

Copy link
Copy Markdown
Owner

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

@theGeekyLad

theGeekyLad commented Nov 9, 2022

Copy link
Copy Markdown
Contributor Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants