Closed qubist closed 5 years ago
@qubist I can offer a bit of help here...
For the environment variable aspect... you'll want to generate a Github token for Github calls.
This is the lib to take a look into: https://www.npmjs.com/package/dotenv
Imagine the env var name is GH_TOKEN
in a .env
file you might set GH_TOKEN=1nasdkfj...
In the nodejs simpleserver.js
you would reference it by process.env.GH_TOKEN
For the HTTP calls...
I would recommend using a POST request with fetch for the client side JS call to the ngrok/simpleserver
For the simpleserver pass through to GH... there's lots of nice simple HTTP libs, I would recommend request. Take the body
of the data passed to the endpoint, and potentially just pass it straight to the github API call that needs to be made
Thanks @Connoropolous!
Whoops; this isn't resolved until we commit 🙃
Resolved by 019b0ea93050857184e605cec063247e53901b65
In my understanding this is what needs to happen:
simpleserver.js
file instead of thecreate-issue.js
file sincecreate-issue.js
is run from the web and doesn't support therequire
method, whilesimpleserver.js
does. This means we can use our env variables insimpleserver.js
to safely authenticate.simpleserver.js
, they must be sent to the server bycreate-issue.js
which is running on the web (Miro). In dev, this should be possible using an HTTP POST to the ngrok URL of the serer.I request help with this.