Deploy prism-mock-server

Instant mock API server from any OpenAPI spec, with validated responses

Deploy prism-mock-server

Just deployed

Prism API Mock Server — turn any OpenAPI/Swagger spec into a live mock API. This template runs Prism — Stoplight's open-source mock server (Apache-2.0, 15M+ Docker pulls) — and boots healthy immediately with a bundled demo API. Zero configuration, zero credentials.

Deploy on Railway

What you get on day one

A working mock API the moment your deployment turns green:

RouteMethodResponse
/healthGET200 {"status":"ok"}
/petsGET200 list of pets
/petsPOST201 created pet — bodies are validated against the spec (invalid → 422)
/pets/{id}GET200 a pet, with named examples rex and whiskers
curl https://your-app.up.railway.app/health
# {"status":"ok"}

Control responses with the Prefer header

HeaderEffect
Prefer: example=whiskersReturn a named example from your spec
Prefer: code=404Force a specific status code, response body from your spec
Prefer: dynamic=trueGenerate fresh random data from your schemas (faker)

CORS is enabled by default — browsers can call your mock from anywhere.

Mock your own API

  1. Fork the repo, edit openapi.json (OpenAPI 2/3 or Postman collections work), deploy your fork.
  2. Set SPEC_PATH to a spec URL and redeploy.
  3. Attach a Railway volume at /specs and set SPEC_PATH=/specs/my-spec.json.

Deploy and Host

About Hosting

Hosting this template provisions a single Railway service, prism-mock-server, built from the pinned stoplight/prism:4 Docker image (digest-pinned for reproducibility) with the demo spec baked in at /spec/openapi.json. Railway assigns a public domain automatically and healthchecks the real GET /health route, so a green deployment means Prism is actually serving. No database, no workers, no credentials to manage. Optional variables: SPEC_PATH (default /spec/openapi.json, accepts a file path or URL) to serve your own spec.

Why Deploy

Deploying Prism manually means wiring a Dockerfile, picking a port, baking a spec, and hoping the healthcheck aligns. This template does all of it: the listen port follows Railway's injected PORT, the demo spec is bundled so the first deploy is green with zero input, and the spec is validated at boot so a broken spec fails loudly instead of serving an empty mock. You get a contract-validated fake API in about a minute instead of an afternoon.

Common Use Cases

  • Unblock frontend or mobile development while the real backend is still being built.
  • Demo an integration against a stable, predictable API without staging data.
  • Contract testing: send real requests and get spec-conformant responses, including validation errors like 422 for malformed bodies.
  • Prototype API designs before writing server code — iterate on the spec, not the plumbing.

Dependencies for

The template has no external dependencies: one stateless service, no database, no message broker, no API keys.

Deployment Dependencies

  • GitHub source: lNamelessl/prism-mock-server (public), built on Railway with the repo's root Dockerfile.
  • Base image: stoplight/prism:4 pinned by digest sha256:08dc16243047a3263beca814b544a5be81e9ec25ca5757cdc4170c84f7431355 (Apache-2.0).
  • Runtime configuration comes from the image (SPEC_PATH=/spec/openapi.json) plus Railway-injected networking; nothing to provision outside this one service.

Template Content

More templates in this category

View Template
open-excalidraw
Self-hostable collaborative drawing built on Excalidraw

Prateek Mohanty
4
View Template
caring-vibrancy
Deploy and Host caring-vibrancy with Railway

5
View Template
Appsmith
Low-code platform for internal tools, dashboards, and admin panels.

Agaz Self-Host
1