Complete the code to create a new Fresh project using the CLI.
deno run -A https://deno.land/x/fresh@1.1.5/cli.ts [1] my_project
The init command initializes a new Fresh project.
Complete the command to run the Fresh development server.
deno task [1]The dev task runs the Fresh development server.
Fix the error in the import statement for Fresh in your main file.
import { start } from "https://deno.land/x/fresh@[1]/server.ts";
The current stable version for Fresh is 1.1.5, which matches the CLI version.
Fill both blanks to create a simple Fresh page component that returns a heading.
import { h } from "preact"; export default function Home() { return <h1>[1]</h1>; } export const handler = [2];
The heading text should be a string inside quotes. The handler is an empty object for default behavior.
Fill all three blanks to define a Fresh route that returns JSON data with a GET handler.
import { Handlers } from "https://deno.land/x/fresh@1.1.5/server.ts"; export const handler: Handlers = { GET(req, ctx) { return ctx.json({ message: [1] }); }, }; export default function Page() { return <p>[2]</p>; } const greeting = [3];
All blanks require the same greeting string with quotes to display and return JSON properly.
