Deno Local Development Guide

Run TypeScript web applications on localhost:8000 using Deno and the Fresh framework, featuring a built-in secure sandbox and toolchain.


Deno is a modern TypeScript/JavaScript runtime with built-in formatting, testing, and a permission model. The full-stack framework Fresh is based on Deno, with the local dev server defaulting to http://localhost:8000.

Installation

curl -fsSL https://deno.land/install.sh | sh
deno --version

Windows: irm https://deno.land/install.ps1 | iex

Quick Start with Fresh

deno run -A -r https://fresh.deno.dev my-app
cd my-app
deno task dev

Access the browser at http://localhost:8000.

Simple HTTP Server

deno run --allow-net https://deno.land/[email protected]/http/file_server.ts
# Default http://localhost:4500

Comparison with Node/Bun

ItemDenoNode
TSNative supportRequires ts-node/compilation
PermissionsExplicit permissions like --allow-netDefault full permissions
npmSupports npm: standardNative ecosystem

Frequently Asked Questions

Permission Errors
During development, commonly use deno task dev (configured with -A in the project) or --allow-net --allow-read.

Port 8000 Occupied
Fresh can change the port in dev.ts or through environment variables.

Summary

Deno + Fresh’s typical local address is http://localhost:8000, suitable for TypeScript-first full-stack projects that aim to reduce configuration files.

访客计数:------ Best viewed in Netscape Navigator · 800×600 © LocalHost Run