genffy / next-sse-demo

Home Page:https://next-sse-demo.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

next-sse-demo

Demo for sse-what-why-how

The demo is inspired by using-fetch-event-source-server-sent-events-react

As we all know, nextjs support stream have two ways:

If we connect the api to a simple nodejs service(eg: use express), sse can be achieved with res.write, but API router with default runtime(nodejs) not.

So why? What does nextjs do on API Routes with nodejs runtime?

refs:

About

https://next-sse-demo.vercel.app


Languages

Language:TypeScript 80.7%Language:JavaScript 17.6%Language:CSS 1.7%