---
title: "Build a REST API with Express, TypeScript, and Deno"
description: "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."
url: "https://swe.quest/articles/build-a-rest-api-with-express-typescript-and-deno-803b55a783fab19e"
canonical: "https://deno.com/blog/build-api-express-typescript"
source: "Deno"
published: "2023-03-08"
difficulty: "medium"
kind: "How-to"
reading_minutes: 5
tags: ["typescript","javascript","api-design","runtimes"]
---

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

A post on [Deno](https://swe.quest/sources/deno.md), published 2023-03-08, 5 min read, How-to. Original: [https://deno.com/blog/build-api-express-typescript](https://deno.com/blog/build-api-express-typescript)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)
- [Runtimes & VMs](https://swe.quest/tags/runtimes.md) (Compilers & runtimes)

## Prerequisites

- Express basics
- TypeScript basics ([easy posts on TypeScript](https://swe.quest/tags/typescript.md?difficulty=easy))

## Keywords

Deno, Express, TypeScript, npm specifiers, deno.jsonc, Deno permissions

## Related posts

- [Build a REST API with Express, TypeScript, and Deno, pt. 2](https://swe.quest/articles/build-a-rest-api-with-express-typescript-and-deno-pt-2-e71cec39c5b23268.md): Deno · 2023-04-06 · Medium · 4 min read · TypeScript, Testing, Containers, API design
  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.
- [Build Apps in Deno with Frameworks such as React, Vue, Express, and more.](https://swe.quest/articles/build-apps-in-deno-with-frameworks-such-as-react-vue-express-and-more-c17610b126d7b402.md): Deno · 2022-11-16 · Medium · 11 min read · JavaScript, Frontend, React, TypeScript
  Deno 1.28's npm support lets you use npm-distributed frameworks like Express, React and Vue directly via \`npm:\` specifiers.
- [Build a dinosaur runner game with Deno, pt. 1](https://swe.quest/articles/build-a-dinosaur-runner-game-with-deno-pt-1-e4d3faa91fec67fd.md): Deno · 2025-12-08 · Medium · 5 min read · JavaScript, TypeScript, Deployment, Serverless
  Part one of a series building a browser dinosaur runner game sets up a Deno project that serves static files and deploys it.
- [Build a Typesafe API with tRPC and Deno](https://swe.quest/articles/build-a-typesafe-api-with-trpc-and-deno-9411ac01cbda8497.md): Deno · 2024-11-19 · Medium · 7 min read · TypeScript, RPC & gRPC, API design, JavaScript
  tRPC lets a Deno server and client share types through an exported router type, with no schema declarations or code generation.
- [Deno 1.34: deno compile supports npm packages](https://swe.quest/articles/deno-1-34-deno-compile-supports-npm-packages-6066648b7bf9ee04.md): Deno · 2023-05-25 · Medium · 6 min read · JavaScript, Runtimes & VMs, Developer tools, TypeScript
  Deno 1.34 lets \`deno compile\` bundle npm packages and their dependencies into a single self-contained executable.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
