> ## Content Index
> Fetch the complete content index at: https://logbuch-dev-blog.nichedthemes.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# A server that answers everything
- URL: https://logbuch-dev-blog.nichedthemes.com/a-server-that-answers-everything/
- Published: 2026-09-07T07:30:00.000Z
- Updated: 2026-09-07T07:30:00.000Z
- Description: Chapter 1 of six: an empty folder, Node 24 and a server that says Hello to every request. No dependencies, now or later.
- Author: Mira Okafor
- Tags: Backend, TypeScript, A tiny HTTP server in TypeScript, #Import 2026-11-19 07:37

This series builds an HTTP server in TypeScript from an empty folder, without a framework and without a single dependency. Six chapters, one a fortnight. By the end it routes, logs, checks a token, has tests and runs under systemd. It is the server stummel ran on for its first year.

You need Node 24, which runs TypeScript files directly by stripping the types. No build step.

## The folder

```console
$ mkdir tiny-server && cd tiny-server
$ npm init -y
$ mkdir src
```

## Eleven lines

```ts
import { createServer } from 'node:http';

const handle = () => new Response('Hello');

createServer(async (req, res) => {
  const response = await handle();
  res.writeHead(response.status, Object.fromEntries(response.headers));
  res.end(await response.text());
}).listen(process.env.PORT ?? 8080, () => {
  console.log(`Listening on :${process.env.PORT ?? 8080}`);
});
```

```console
$ node src/server.ts
Listening on :8080
$ curl localhost:8080
Hello
```

`handle` returns a `Response` from the start, though nothing needs it yet. Chapter 2 explains why.