Skip to content

Deno Fresh

https://fresh.deno.dev/

Edge-native web framework.

Fresh is a full stack modern web framework for JavaScript and TypeScript developers, designed to make it trivial to create high-quality, performant, and personalized web applications.

Create a project

https://fresh.deno.dev/docs/getting-started/create-a-project

Example chat project

https://github.com/lucacasonato/deploy_chat/

Notes about Fresh code

Default entry is mod.ts which is a Rust convention.

Deno has no default to import directories like Node does.

src/runtime/head.ts Has the head component

src/runtime/csp/ts Has content security policies

src/dev/deps.ts Has the dependencies

src/dev/imports.ts Imports preact, signals, twind

src/server/mod.ts Handles routes manifest

src/server/deps.ts rutt as the router, http serve

fresh.gen.ts contains routes, genreated during development.

A hash # creates a private class member in javascript.