Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Deno 4 min read How-to mediumAdept

Build a REST API with Express, TypeScript, and Deno, pt. 2

An Express REST API running on Deno gets integration tests via Deno.test using fetch against a configurable staging URL, and HTTP latency benchmarks via Deno.bench in a _bench file. The service is then containerized with a Dockerfile that runs deno cache and a deno.jsonc start task, launched with docker compose, and tested and benchmarked against the running container. Commenting out verbose request logging in middleware noticeably improves benchmark results, and deno bench --json can export results for automated tracking.

Related posts

  • Build a REST API with Express, TypeScript, and Deno

    Deno mediumAdept

    Deno runs Express with TypeScript without any TypeScript build configuration: Express is imported through an npm: specifier and its types are pulled in with a @deno-types comment. The walkthrough sets up a server that reads its port from the environment and starts it with explicit Deno permissions (--allow-read, --allow-net, --allow-env), which limits what third-party code can access. It also defines dev and start tasks in deno.jsonc, adds a request-logging middleware, and serves mock user data imported as JSON through /users and /users/:id routes, giving a REST API starting point in under 30 lines.

  • Build a Cross-Platform CLI with Deno in 5 minutes

    Deno mediumAdept

    Deno's built-in tooling covers the full path to a small cross-platform CLI, shown here by building `greetme-cli`. The std `flags` module's `parse()` handles argument parsing with typed flags, aliases and defaults. Deno KV persists settings across runs and needs an explicit path when compiled, and the web `prompt()` API handles interactive input. The tutorial finishes with `Deno.test` for unit tests and `deno compile` to ship a single executable binary, noting the required `--unstable`, `--allow-read` and `--allow-write` flags.

  • Build a dinosaur runner game with Deno, pt. 1

    Deno mediumAdept

    Part one of a series building a browser dinosaur runner game sets up a Deno project that serves static files and deploys it. It covers `deno init`, adding the Oak framework from JSR, defining `dev` and `start` tasks in deno.json with explicit `--allow-net`/`--allow-read`/`--env-file` permissions, and a minimal Oak server that serves `public/` via `context.send`. It also adds an `/api` router with a health check endpoint, then deploys with `deno deploy` using `src/main.ts` as the entry point.

  • Build Apps in Deno with Frameworks such as React, Vue, Express, and more.

    Deno mediumAdept

    Deno 1.28's npm support lets you use npm-distributed frameworks like Express, React and Vue directly via `npm:` specifiers. You don't need package.json, node_modules or a separate install step, and Deno's built-in toolchain is available throughout. Step-by-step examples build a dinosaur API with Express. They then build the same dinosaur list/detail app in React (Vite scaffold via create-vite-extra, an Oak backend with CORS, react-router-dom) and in Vue (reactive store, Suspense, vue-router).

  • Build a Typesafe API with tRPC and Deno

    Deno mediumAdept

    tRPC lets a Deno server and client share types through an exported router type, with no schema declarations or code generation. The tutorial installs tRPC v11 and Zod from npm, then builds a file-backed dinosaur API with query, mutation and async-iterable streaming procedures, served by tRPC's standalone HTTP adapter. The client uses splitLink with the batch-stream and subscription links and gets compile-time checking from the imported AppRouter type. Passing a number instead of a string shows Zod rejecting the input at runtime with an invalid_type error.

The quest for software engineering knowledge.

Look:
Layout: