Servers and APIs

I asked OpenAI’s GPT-3 if it was possible to make an HTTP/3 request with Node.js, and the result was weird.

Can you make an HTTP/3 request with Node.js? I asked that question on OpenAI’s playground to see how it handles the question that doesn’t have the answer.

I asked OpenAI’s GPT-3 if it was possible to make an HTTP/3 request with Node.js, and the result was weird. Read More »

Push instant updates with EventSource API

EventSource is a handy API supported by all browsers, which runs over the regular HTTP protocol and doesn’t require setting up a separate WebSocket service. However, it has limitations, such as data being one-directional (server to client) or a connection being constantly occupied. Let’s dive in.

Push instant updates with EventSource API Read More »

5 ways to create an HTTP/HTTP2 server with Node.js.

Node.js can be used to easily run a web server by using the built-in HTTP module or a web framework such as Express, Hapi, or Fastify. The process involves creating an HTTP server, setting up routes, and starting the server to listen on a specific port for incoming requests.

5 ways to create an HTTP/HTTP2 server with Node.js. Read More »

Automatically serve .webp or .avif with Node.js based on browser request headers.

Let’s chew down another issue: we have a /public folder with images, and depending on the browser we want to serve a WEBP or AVIF to save bandwidth and decrease page load time.

Automatically serve .webp or .avif with Node.js based on browser request headers. Read More »