The server app is nothing more than a normal TypeScript project built on top of node:http.
It contains a single src folder with the main entry point main.ts. The only configuration file necessary at this point is tsconfig.json.
You can generate a
tsconfig.jsonfile using TSConfig Guide.
The server is executed using tsx:
tsxallows running TypeScript files directly with nodejs.
pnpm add -D tsxThe initial scripts configuration in package.json contains the typecheck command and dev to execute tsx in watch mode:
package.json
"scripts": {
"dev": "tsx watch src/main.ts",
"typecheck": "tsc"
}