Files
insomnia/packages/insomnia-test/misc/server/gitlab-api.ts
T
Bob QiuandClaude Sonnet 5.5 55f97f3f9c refactor(insomnia-test): replace the standalone mock servers with the smoke-test mock server
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>
2026-11-05 11:08:34 +08:00

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',
});
});
}