Playground environment allowing users to try out Turf's features and create (hopefully)
easy to debug examples for issues they encountered using any Turf package.
The app is currently hosted at https://turf-sandbox.netlify.app.
Write your code on the editor and return a valid GeoJSON object, it will be rendered on the map on the right.
-
Add package selectionWe'll just use the latest version fromhttps://npmcdn.com/@turf/turf
-
Allow the user to save code snippets and create links to share the examples
-
Add instructions on how to use the tool
-
Evaluate strategies to improve system security
This project has been inspired by Try Carbon (), the test environment for Carbon PHP.
The following articles and projects were very useful for the development of this project:
- Build your own interactive JavaScript playground
- How to Write Your Own JSFiddle
- Best practices for building your own live paste bin
- Register the app on GitHub to obtain the
ClientID
andClientSecret
for the app - From the browser the client makes a request to the
https://github.com/login/oauth/authorize
with the appropriate app'sClientID
- The above operation allows the user to authorizes the client to access the user's GitHub data and redirects the user to the callback URL we defined when registering app
- Now (here on the server) with the use of the obtained
RequestToken
in addition toClientID
andClientSecret
we callhttps://github.com/login/oauth/access_token
to request an APIAccessToken
- If all the values we've provided are valid, the API will respond with the
AccessToken
for client to make authorised requests to the GitHub API, which we store in the Local Storage.
Set your env variables in .env
.
Make sure you have Netlify CLI installed globally.
Run netlify dev
.