<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mock Server</title>
    <description>The latest articles on DEV Community by Mock Server (@mock_server).</description>
    <link>https://dev.to/mock_server</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3812347%2F309c03bb-8f14-41ca-ba93-4c1c9f6b6894.png</url>
      <title>DEV Community: Mock Server</title>
      <link>https://dev.to/mock_server</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mock_server"/>
    <language>en</language>
    <item>
      <title>5 ways to unblock yourself when the backend API isn't ready</title>
      <dc:creator>Mock Server</dc:creator>
      <pubDate>Sat, 14 Mar 2026 12:32:46 +0000</pubDate>
      <link>https://dev.to/mock_server/5-ways-to-unblock-yourself-when-the-backend-api-isnt-ready-4bhj</link>
      <guid>https://dev.to/mock_server/5-ways-to-unblock-yourself-when-the-backend-api-isnt-ready-4bhj</guid>
      <description>&lt;p&gt;You're mid-feature. You know exactly what the UI needs to do. The Figma file is open. You're ready.&lt;br&gt;
And then you hit it — the backend endpoint doesn't exist yet.&lt;br&gt;
You could wait. Or you could keep moving. Here are 5 ways developers actually handle this, from the quick-and-dirty to the more structured.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Hardcode the JSON directly in your component
Yeah, it's ugly. But don't pretend you haven't done it.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;products&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Wireless Headphones&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;149.99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;in_stock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Mechanical Keyboard&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;89.99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;in_stock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;When to use it: You need to unblock yourself for the next 30 minutes and you'll throw this away by end of day.&lt;br&gt;
When NOT to use it: When your teammate also needs the same data. When you need to test loading states. When you forget to remove it before pushing to main (we've all been there).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run json-server locally
json-server is a classic. You create a &lt;code&gt;db.json&lt;/code&gt; file, run one command, and you have a full fake REST API running on localhost.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; json-server
json-server &lt;span class="nt"&gt;--watch&lt;/span&gt; db.json &lt;span class="nt"&gt;--port&lt;/span&gt; 3001
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Your &lt;code&gt;db.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"products"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Wireless Headphones"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;149.99&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Mechanical Keyboard"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;89.99&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now &lt;code&gt;GET /products&lt;/code&gt; and &lt;code&gt;GET /products/1&lt;/code&gt; both work out of the box.&lt;br&gt;
When to use it: You want a persistent fake API that supports GET, POST, PUT, DELETE without writing any code.&lt;br&gt;
When NOT to use it: When your teammate on a different machine needs the same endpoint. It runs locally — nobody else can hit it unless you do extra networking setup.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Mock Service Worker (MSW)
MSW intercepts requests at the network level inside your browser using a service worker. Your app thinks it's hitting a real API. It isn't.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;rest&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;msw&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;setupWorker&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;msw&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;worker&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;setupWorker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;rest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/products&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;res&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Wireless Headphones&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;149.99&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When to use it: You want mocking baked into your codebase, colocated with your tests, and you're comfortable with some initial setup overhead.&lt;br&gt;
When NOT to use it: You just need a URL to paste into Postman or share with a mobile dev. MSW lives inside your frontend — it's not a real URL anyone else can call.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Postman Mock Servers&lt;br&gt;
If your team is already using Postman, their mock server feature is solid. You define a collection, add example responses to each request, and Postman gives you a real hosted URL.&lt;br&gt;
The URL looks like &lt;code&gt;https://abc123.mock.pstmn.io/products&lt;/code&gt; and anyone on your team can hit it.&lt;br&gt;
When to use it: Your team already lives in Postman and you want mocks that match your existing API documentation.&lt;br&gt;
When NOT to use it: You're working solo and don't want to context-switch into Postman just to create one quick mock. The setup flow is not fast.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An online mock tool — instant URL, no setup&lt;br&gt;
Sometimes you just need a live URL in under a minute. No install, no config, no service worker, no Postman collection.&lt;br&gt;
This is what tools like mockserver.in are built for. You describe your endpoint — or paste a schema — and it gives you a live URL immediately. The AI generation feature is genuinely useful here: type "return a list of 5 products with name, price, and stock status" and it writes the JSON for you.&lt;br&gt;
What makes this approach different from the others:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The URL is publicly accessible — your mobile teammate can hit the same endpoint&lt;br&gt;
Real-time traffic logs show every incoming request with headers and body, which is useful when you're not sure what your app is actually sending&lt;br&gt;
You can simulate delay and intermittent failures — so you can test what your UI does when the API takes 3 seconds, or fails 20% of the time&lt;/p&gt;

&lt;p&gt;When to use it: You need a shareable URL fast, you're testing across platforms (web + iOS + Android), or you want to test your error handling without touching the backend.&lt;br&gt;
When NOT to use it: If your mocks need to live inside your codebase and run as part of your test suite, MSW is the better fit.&lt;/p&gt;

&lt;p&gt;Which one should you use?&lt;br&gt;
Honestly, it depends on the situation:&lt;/p&gt;

&lt;p&gt;30-second fix, throw away later → hardcode it&lt;br&gt;
Local development with full CRUD → json-server&lt;br&gt;
Mocking inside your test suite → MSW&lt;br&gt;
Team already on Postman → Postman mock servers&lt;br&gt;
Need a shareable URL fast, cross-platform, with traffic logs → online mock tool&lt;/p&gt;

&lt;p&gt;Most developers I've talked to end up using 2-3 of these depending on the context. The key is knowing which tool fits which situation instead of defaulting to the same approach every time.&lt;br&gt;
What's your go-to when the backend isn't ready? Drop it in the comments.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>frontend</category>
      <category>productivity</category>
      <category>api</category>
    </item>
    <item>
      <title>Stop Waiting for the Backend — Mock Your APIs in 30 Seconds</title>
      <dc:creator>Mock Server</dc:creator>
      <pubDate>Sun, 08 Mar 2026 02:50:30 +0000</pubDate>
      <link>https://dev.to/mock_server/stop-waiting-for-the-backend-mock-your-apis-in-30-seconds-56m4</link>
      <guid>https://dev.to/mock_server/stop-waiting-for-the-backend-mock-your-apis-in-30-seconds-56m4</guid>
      <description>&lt;p&gt;Every frontend developer knows this feeling.&lt;br&gt;
The backend isn't ready. You've got a Figma file, a deadline, and absolutely nothing to call. So you do one of three things:&lt;br&gt;
Hardcode JSON directly into your component. Spin up json-server locally. Or just wait.&lt;br&gt;
All three are painful in different ways.&lt;/p&gt;

&lt;p&gt;The real problem with existing mock tools&lt;br&gt;
The tools that exist today fall into two camps.&lt;br&gt;
Too heavy. MSW is powerful but requires install, config, and service worker setup. Mockoon is great but it's a desktop app — your mock lives on your machine, nobody else can use it. MirageJS requires you to essentially rebuild your API layer inside your frontend.&lt;br&gt;
Too simple. Most online mock tools give you a JSON endpoint but nothing else. No error simulation. No latency. No way to test what happens when your API is slow or broken.&lt;br&gt;
Neither camp solves the actual problem: I need a working API URL my whole team can hit in under a minute, without setting anything up.&lt;/p&gt;

&lt;p&gt;What frontend devs actually need&lt;br&gt;
Think about the real workflow:&lt;/p&gt;

&lt;p&gt;Designer hands off a screen&lt;br&gt;
Frontend dev needs to build it&lt;br&gt;
Backend endpoint doesn't exist yet&lt;br&gt;
Frontend dev is blocked&lt;/p&gt;

&lt;p&gt;What unblocks them isn't a perfectly architected mock system. It's a URL that returns the right shape of data, right now, that they can share with a teammate without any setup.&lt;br&gt;
That's it.&lt;/p&gt;

&lt;p&gt;The gap nobody was filling&lt;br&gt;
When building my own projects I kept running into the same wall. I didn't want to install anything. I didn't want to write config files. I didn't want a mock that only lived on my laptop.&lt;br&gt;
I also wanted to test the hard stuff — what does my UI do when the API takes 3 seconds to respond? What happens when it fails 30% of the time? These are real production scenarios that most mock tools completely ignore.&lt;br&gt;
Intermittent failures especially. Every tool lets you set a mock to always return 500. But real APIs don't always fail — they fail sometimes. Testing retry logic means you need a mock that fails 1 in 3 requests. I couldn't find anything that did this simply.&lt;br&gt;
So I built mockserver.in.&lt;/p&gt;

&lt;p&gt;How it works&lt;br&gt;
Three ways to create a mock:&lt;br&gt;
Plain English — Type "return a list of 5 products with name, price, and image URL." It generates the JSON and gives you a live URL instantly.&lt;br&gt;
JSON editor — Paste your own response body, set your status code, done.&lt;br&gt;
Form — Fill in fields if you prefer structured input.&lt;br&gt;
Every mock gets a shareable URL immediately. No account needed to get started.&lt;br&gt;
Then you can layer on:&lt;/p&gt;

&lt;p&gt;Fixed or random latency&lt;br&gt;
Specific HTTP status codes&lt;br&gt;
Intermittent failure rates — "fail 20% of requests"&lt;br&gt;
Timeout simulation&lt;/p&gt;

&lt;p&gt;Your frontend hits a real URL. Your mobile team hits the same URL. No one needs to run anything locally.&lt;/p&gt;

&lt;p&gt;Who this is for&lt;/p&gt;

&lt;p&gt;Frontend devs blocked by missing backend endpoints&lt;br&gt;
Mobile devs who need a stable URL during development&lt;br&gt;
Teams where backend and frontend work in parallel&lt;br&gt;
Anyone who wants to test loading states, error handling, and retry logic without touching the backend&lt;/p&gt;

&lt;p&gt;Try it&lt;br&gt;
&lt;a href="https://mockserver.in" rel="noopener noreferrer"&gt;mockserver.in&lt;/a&gt; — free for 20 mocks, no credit card, no setup.&lt;br&gt;
Describe your endpoint and get a URL in 30 seconds.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>frontend</category>
      <category>productivity</category>
      <category>mobile</category>
    </item>
  </channel>
</rss>
