Menu

How I set up a JSON mock server for a frontend team in an afternoon
📰

How I set up a JSON mock server for a frontend team in an afternoon

DEV Community: javascript·alexrai·18 days ago
#wj4zVsug
#devtojavascript#devto#dev#mock#json
Long article (1022 words) — no AI summary yet.
Reading 0:00
15s threshold

Last spring our frontend team had a sprint planned around a new orders dashboard. The designs were done, the tickets were groomed, and the backend was nowhere close. The API contract existed as a shared doc with three open comments on it. Four frontend devs were about to spend two weeks building against TODO and hard-coded arrays.

I'd seen that movie before. Everyone writes their own fake data inside components, nobody's fake data matches anyone else's, and the week the real API lands you spend two days ripping out mocks and finding out the date format was different all along.

So I blocked off an afternoon and gave the team a shared mock server instead. Here's exactly what I did, what worked, and the one thing I'd do differently.

Start from the contract, not from the UI

The temptation is to look at the Figma file and invent data that makes the screens look good. Don't. Open the API contract (or whatever the backend team has written down, even a Slack thread) and copy the field names exactly.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.