A modern Deno server implementation with hot reloading capabilities and strict TypeScript configuration.
View Architecture Diagram
graph TD
A[Browser] -->|HTTP Request| B[Deno Server]
B -->|Static Files| C[Public Directory]
B -->|Hot Reload| A
C -->|main.js| D[JavaScript]
C -->|main.css| E[Styles]
View Project Structure Diagram
graph TD
A[deno-server] -->|Contains| B[src]
A -->|Config| C[deno.json]
B -->|Entry| D[server.ts]
B -->|Static| E[public]
E -->|Scripts| F[main.js]
E -->|Styles| G[main.css]
- Hot module reloading
- Static file serving
- TypeScript support
- Strict type checking
- Development mode with watch
- Formatting and linting built-in
The project uses deno.json
for configuration with the following features:
{
"compilerOptions": {
"lib": ["deno.window"],
"strict": true
}
}
deno task dev
- Run in development mode with hot reloadingdeno task start
- Run in production modedeno task test
- Run testsdeno task lint
- Lint codedeno task fmt
- Format code
-
Install Deno:
curl -fsSL https://deno.land/x/install/install.sh | sh
-
Run the development server:
deno task dev
-
Access the server at
http://localhost:8000
View Development Flow Diagram
sequenceDiagram
participant Browser
participant Server
participant FileSystem
Browser->>Server: Request page
Server->>FileSystem: Read static files
FileSystem->>Server: Return file contents
Server->>Browser: Serve HTML/JS/CSS
loop Hot Reload
FileSystem->>Server: File change detected
Server->>Browser: Push update
Browser->>Browser: Update content
end
- Deno 2.2 or higher
- Modern browser (for development)
MIT