mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5482] [MERGED] feature: mock server #5232
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5232
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5482
Author: @mirarifhasan
Created: 10/13/2025
Status: ✅ Merged
Merged: 10/27/2025
Merged by: @jamesgeorge007
Base:
next← Head:mock-server📝 Commits (10+)
8bcf3fdfeat: add mock server (#5385)1a43636feat: implement MockServer migration and update GraphQL queries/mutations to use collection ID0b17b99refactor: mock server to support user and team workspaces556d1bbrefactor: mock server routing and add mockExamples sync3b50bdcfeat: mock request handling and matching6d1db3efeat: update GraphQL mutations and queries to include workspace details and remove user field5a318fbfeat: enhance MockServer types and queries to support workspace details and improve backward compatibility9a3d602feat: enhance createMockServer function to include workspace type and visibility optionsa6dc91cfeat: update createMockServer mutation to use WorkspaceType enum for workspaceType950bfd3feat: add mockExamples field to user and team request test data📊 Changes
59 files changed (+6249 additions, -69 deletions)
View changed files
📝
aio-multiport-setup.Caddyfile(+12 -1)📝
aio-subpath-access.Caddyfile(+12 -1)📝
packages/hoppscotch-backend/backend.Caddyfile(+12 -1)➕
packages/hoppscotch-backend/prisma/migrations/20251016080714_mock_server/migration.sql(+142 -0)📝
packages/hoppscotch-backend/prisma/schema.prisma(+127 -59)📝
packages/hoppscotch-backend/src/app.module.ts(+2 -0)📝
packages/hoppscotch-backend/src/errors.ts(+49 -0)📝
packages/hoppscotch-backend/src/gql-schema.ts(+2 -0)📝
packages/hoppscotch-backend/src/infra-config/helper.ts(+5 -0)📝
packages/hoppscotch-backend/src/infra-config/infra-config.service.ts(+11 -0)➕
packages/hoppscotch-backend/src/mock-server/mock-request.guard.ts(+274 -0)➕
packages/hoppscotch-backend/src/mock-server/mock-server-analytics.service.ts(+43 -0)➕
packages/hoppscotch-backend/src/mock-server/mock-server-logging.interceptor.ts(+169 -0)➕
packages/hoppscotch-backend/src/mock-server/mock-server.controller.ts(+124 -0)➕
packages/hoppscotch-backend/src/mock-server/mock-server.model.ts(+294 -0)➕
packages/hoppscotch-backend/src/mock-server/mock-server.module.ts(+22 -0)➕
packages/hoppscotch-backend/src/mock-server/mock-server.resolver.ts(+222 -0)➕
packages/hoppscotch-backend/src/mock-server/mock-server.service.spec.ts(+1157 -0)➕
packages/hoppscotch-backend/src/mock-server/mock-server.service.ts(+1043 -0)📝
packages/hoppscotch-backend/src/orchestration/sort/sort.service.spec.ts(+1 -1)...and 39 more files
📄 Description
Closes BE-659
Related to #1598.
What's changed
This PR introduces a mock server feature that enables users to create and manage API mock servers based on their collections. The mock servers can simulate API responses using example data stored in collections, supporting both user and team workspaces with subdomain-based and path-based routing patterns.
Key changes:
Backend Changes
Mock Server can be created, updated, and deleted (soft delete) via GQL mutations for both Personal and Team workspaces
Following queries to view mock servers. All have access permission checks.
You can see the mock server's request logs
For analytics purposes
Notes to reviewers
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.