Files
insomnia/packages/insomnia-smoke-test/server/github-api.ts
Jack Kavanagh c62a114d28 Chore: eslint-autofixes (#9421)
* sort and remove a few

* autofix 1

* remove useless undefined

* fix types

* number seperators

* native coercion

* utf8

* explicit number

* dom node dataset

* explicit unused catch

* array find

* fix types

* prefer negative index

* from code point

* fix error layout

* prefer ternary

* explicit length

* useless case

* named functions

* utf8

* import style

* default parameters

* no instance of

* clone

* use regex test

* single call

* prettier

* fix types

* Revert "use regex test"

This reverts commit 8fb9e991fffa9e3a51ff75cdc29dad331ed2fb66.
2025-11-27 09:36:52 +00:00

49 lines
1.1 KiB
TypeScript

import type { Application } from 'express';
export default function setup(app: Application) {
app.get('/github-api/rest/user/repos', (_req, res) => {
res.status(200).send([
{
id: 123_456,
full_name: 'kong-test/sleepless',
clone_url: 'https://github.com/kong-test/sleepless.git',
permissions: {
push: true,
pull: true,
},
},
]);
});
app.get('/github-api/rest/user/emails', (_req, res) => {
res.status(200).send([
{
email: 'curtain@drape.net',
primary: true,
},
]);
});
app.get('/github-api/rest/user', (_req, res) => {
res.status(200).send({
name: 'Insomnia',
login: 'insomnia-infra',
email: null,
avatar_url: 'https://github.com/insomnia-infra.png',
url: 'https://api.github.com/users/insomnia-infra',
});
});
app.post('/v1/oauth/github', (_req, res) => {
res.status(200).send({
access_token: '123456789',
});
});
app.post('/v1/oauth/github-app', (_req, res) => {
res.status(200).send({
access_token: '123456789',
});
});
}