Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This comment has been deleted
bodyParser is now deprecated and its functionality is now included in Express, so the require(‘body-parser’) line needs to be deleted and these lines:
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
Change to:
app.use(express.json());
app.use(express.urlencoded({extended: false}));
Also the listen port is set to 3000, but all the port references after that are 3001.
And there’s a typo re: respsonse in function addFact.
Other than those minor issues, great tutorial saving me time in my SSE app development. Thanks!
Correct me if I’m missing something, but it seems that async and next should both be removed from the addFact() declaration because there is no await nor next() within the function.
How this exact example can be done if node application has more than 1 process. Let’s say that application works in pm2 cluster mode.
This comment has been deleted
This comment has been deleted
If you’re seeing double connections from the client, that’s useEffect running twice because of React Strict mode, which is on in dev by default
StrictMode renders components twice (on dev but not production) in order to detect any problems with your code and warn you about them (which can be quite useful).
You can remove the strict mode tags from index.js.
The provided example is just too trivial and can’t be directly applied to any real production application. What if you have multiple server instances and a load-balancer? What if you need to send events from server-side workers?
“After the POST request, the second terminal window should update with the new fact”
It should but it doesn’t. The list remain empty