Files
main.tsmain
What you'll learn
- Stream a text body with streamText() and its write(), writeln() and sleep()
- Send server-sent events with streamSSE() and writeSSE({ event, data, id }), and stop when the client goes away
- Understand why an error inside a stream cannot become an error response
Press Run tests to start the app. Its log appears here.Graded endpoints
The ordinary route beside the streamed ones: built whole, sent whole
streamText() writes the header and one line per cat, then ends the response; the helper sets text/plain and nosniff
streamSSE() sends one adopted event per cat, then pings forever; the grader reads for 700 ms after the first event and checks what arrived