import { asset, Head } from "$fresh/runtime.ts"; import { Handlers, PageProps } from "$fresh/server.ts"; import Counter from "../islands/Counter.tsx"; import LemonDrop from "../islands/LemonDrop.tsx"; import Footer from "../components/Footer.tsx"; import VERSIONS from "../../versions.json" assert { type: "json" }; import * as FeatureIcons from "../components/FeatureIcons.tsx"; import CopyArea from "../islands/CopyArea.tsx"; import * as Icons from "../components/Icons.tsx"; import Projects from "../components/Projects.tsx"; import projects from "../data/showcase.json" assert { type: "json" }; export const handler: Handlers = { GET(req) { const accept = req.headers.get("accept"); let path = "/docs/concepts/updating"; if (accept && !accept.includes("text/html")) { path = `https://deno.land/x/fresh@${VERSIONS[0]}/update.ts`; } return new Response(`Redirecting to ${path}`, { headers: { "Location": path }, status: 307, }); }, }; const TITLE = "fresh - The next-gen web framework."; const DESCRIPTION = "Just in time edge rendering, island based interactivity, and no configuration TypeScript support using Deno."; export default function MainPage(props: PageProps) { const ogImageUrl = new URL(asset("/home-og.png"), props.url).href; const origin = `${props.url.protocol}//${props.url.host}`; return ( <>
Built for speed, reliability, and simplicity.
Fresh embraces the tried and true design of server side rendering and progressive enhancement on the client side.
To bootstrap a new project:
Enter the newly created project directory and run the following command to start the development server:
You can now open{" "} http://localhost:8000 {" "} in your browser to view the page.
A more in-depth{" "} Getting Started {" "} guide is available in{" "} the docs.
This text is being server side rendered on the fly. It was rendered at {" "} {timeFmt.format(new Date())}.
The counter below was rendered on the server with a starting value of 3, and was then hydrated on the client to provide interactivity. Try out the buttons!
Only the JS required to render that counter is sent to the client.
Below is a selection of projects that have been built with Fresh.