mirror of
https://github.com/Kong/insomnia.git
synced 2026-11-07 21:44:32 -05:00
Remove the misc/*-server.ts scripts and their per-server webServer entries.
Run a single mock server (misc/server), copied from insomnia-smoke-test and
adapted to native-ESM node (import.meta.dirname, .ts imports, generated
certs, no cross-package imports).
Additions on top of the smoke server: misc/server/mock-api.ts (account and
session state, _admin hooks, Cloud Sync GraphQL, vault, collaborators; runs
as middleware and falls through), an httpbin-style /post, a catch-all 200 {}
and socket.io moved to :3000. HTTP_SERVER now points at the single server.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
40 lines
990 B
TypeScript
40 lines
990 B
TypeScript
import type { Application } from 'express';
|
|
|
|
export default function setup(app: Application) {
|
|
app.post('/gitlab-api/api/graphql', (_req, res) => {
|
|
res.status(200).send({
|
|
data: {
|
|
currentUser: {
|
|
publicEmail: null,
|
|
name: 'Mark Kim',
|
|
avatarUrl: null,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
app.get('/v1/oauth/gitlab/config', (_req, res) => {
|
|
res.status(200).send({
|
|
applicationId: 'gitlab-oauth-client-id',
|
|
redirectUri: 'http://localhost:3000/not-implemented',
|
|
});
|
|
});
|
|
|
|
app.post('/gitlab-api/oauth/token', (_req, res) => {
|
|
res.status(200).send({
|
|
access_token: '123456789',
|
|
created_at: 1_652_246_628,
|
|
expires_in: 6955,
|
|
refresh_token: '1234567891',
|
|
scope: 'api read_user write_repository read_repository email',
|
|
token_type: 'Bearer',
|
|
});
|
|
});
|
|
|
|
app.post('/gitlab-api/oauth/authorize', (_req, res) => {
|
|
res.status(200).send({
|
|
access_token: '123456789',
|
|
});
|
|
});
|
|
}
|