insomnia/packages/insomnia-smoke-test/server/github-api.ts
James Gatz 47d2a71279
Add GitHub OAuth for git repos (#4429)
* add sign in with github

* fix authentication url not being reset

* Add error handling for graphql query results

* move desctructuring to function arguments

* remove unused input prop

* Respect INSOMNIA_DATA_PATH for electron data regardless of environment

* fix lint error and update uuid usage

Co-authored-by: David Marby <david@dmarby.se>
2022-03-18 10:57:12 +01:00

21 lines
433 B
TypeScript

import type { Application } from 'express';
export default (app: Application) => {
app.post('/github-api/graphql', (_req, res) => {
res.status(200).send({
data: {
viewer: {
name: 'InsomniaUser',
email: 'sleepyhead@email.com',
},
},
});
});
app.post('/api/v1/oauth/github', (_req, res) => {
res.status(200).send({
'access_token': '123456789',
});
});
};