What statuses does this Elysia program print?

from Elysia
Elysia 1.4.30 / Bun 1.3.10 / TypeScript 6 beginner 2 min

What statuses does this Elysia program print?

TypeScript
import { Elysia, t } from 'elysia'

const app = new Elysia().post('/orders', ({ body }) => body.quantity, {
  body: t.Object({ quantity: t.Integer({ minimum: 1 }) })
})

for (const quantity of [2, 0]) {
  const response = await app.handle(new Request('http://local/orders', {
    method: 'POST',
    headers: { 'content-type': 'application/json' },
    body: JSON.stringify({ quantity })
  }))
  console.log(response.status)
}
Open in playground
Report an error