QUIZ YOUR SLOP

Meet the Slop Tavern

The Slop Tavern is the Tutorial's Project: an RPG tavern ordering app made to measure for the game, with ~30 TypeScript files — a React site, a Node API, a SQL database and a queue worker. It has slop planted on purpose: a lying comment, a total computed differently in the front end and in the API, a function with a misleading name, dead code and a swallowed error.

The map

Four Territories — Hall, Counter, Cellar and Kitchen — and seven Regions. This is the map of a Fullstack Bard after the first victory: Cart & Checkout revealed, its neighbours unlocked and the rest still in the Fog.

Dependency: The Menu puts items in the cart with useCartCall: POST /orders creates the order when the customer clicks PayDependency: The checkout uses formatGold to show the totalHALLCOUNTERCELLARKITCHENMenuCart & Checkout ★Orders API???Grimoire??????DependencyCallDependency

★ revealed · ⬚ unlocked · ⟳ outdated · ☁ Fog

Pick a region on the map to see what it does.

A sample Challenge

From the Orders API, the entry region of the Backend Knight · Multiple choice

When the Checkout calls POST /orders, which API handler receives the call?

  • A) listItemsHandler
  • B) createOrderHandler
  • C) getOrderHandler
  • D) chargeOrder
Show the answer

Answer key: B) createOrderHandler

server.ts registers the routes on the Router: POST /orders goes to createOrderHandler, which checks the body's shape with parseCreateOrder and hands the order to createOrder().

📜 api/src/server.ts:9-11
router.get('/items', listItemsHandler);router.post('/orders', createOrderHandler);router.get('/orders/:id', getOrderHandler);

Ready to face the Guardian?