What is the first step to create a new Fresh project?
Run the command deno run -A https://fresh.deno.dev in your terminal to start a new Fresh project setup.
Click to reveal answer
beginner
What does the -A flag mean when running the Fresh project setup command?
The -A flag stands for 'allow all' permissions, letting the script access files, network, and environment needed to create the project.
Click to reveal answer
beginner
After creating a Fresh project, which command starts the development server?
Use deno task start to run the development server and see your Fresh app in the browser.
Click to reveal answer
beginner
Where does Fresh store the project files after creation?
Fresh creates a new folder with your project name containing all files like main.ts, routes/, and islands/ folders.
Click to reveal answer
intermediate
Why is Fresh considered a good choice for building web apps with Deno?
Fresh uses server-side rendering with islands architecture, making apps fast and efficient without needing a build step.
Click to reveal answer
Which command initializes a new Fresh project?
Adeno init fresh
Bnpm create fresh-app
Cdeno run -A https://fresh.deno.dev
Dfresh new project
✗ Incorrect
The correct command is deno run -A https://fresh.deno.dev to start a Fresh project.
What does the -A flag do in the Fresh setup command?
AGrants all permissions (network, files, environment) needed by the script
BEnables strict mode in Deno
CDisables network access
DRuns the project in production mode
✗ Incorrect
The -A flag stands for '--allow-all', letting the script access files, network, and environment needed to create the project.
After creating a Fresh project, which folder contains your page routes?
Apages/
Broutes/
Csrc/
Dcomponents/
✗ Incorrect
Fresh uses a routes/ folder to organize page routes.
How do you start the Fresh development server?
Adeno task start
Bdeno run start
Cfresh serve
Dnpm start
✗ Incorrect
Use deno task start to launch the Fresh development server.
What is a key feature of Fresh that improves app speed?
AHeavy use of JavaScript frameworks
BClient-side rendering only
CNo use of TypeScript
DIslands architecture with server-side rendering
✗ Incorrect
Fresh uses islands architecture and server-side rendering to make apps fast and efficient.
Describe the steps to create and run a new Fresh project using Deno.
Think about the commands you type in the terminal from start to running the app.
You got /4 concepts.
Explain why Fresh uses the -A flag and what it means for your project.
Consider Deno's permission model and why the setup script needs it.
You got /4 concepts.
Practice
(1/5)
1. What command do you use to create a new Fresh project in Deno?
easy
A. deno fresh create
B. deno run -A --unstable https://fresh.deno.dev/init <project-name>
C. deno init fresh
D. deno start fresh
Solution
Step 1: Understand Fresh project creation command
The official way to create a Fresh project is by running a Deno script from the URL https://fresh.deno.dev/init with the project name as argument.
Step 2: Identify the correct command syntax
The command includes 'deno run -A --unstable' followed by the URL and the project name, exactly as in deno run -A --unstable https://fresh.deno.dev/init <project-name>.
Final Answer:
deno run -A --unstable https://fresh.deno.dev/init <project-name> -> Option B
Quick Check:
Fresh project creation = deno run -A --unstable https://fresh.deno.dev/init <project-name> [OK]
Hint: Remember the URL and flags for Fresh init command [OK]
Common Mistakes:
Using 'deno fresh create' which is not a valid command
Omitting the --unstable flag
Trying to use 'deno init fresh' which doesn't exist
2. Which of the following commands correctly starts the Fresh development server after creating a project?
easy
A. deno run -A --unstable main.ts
B. deno fresh start
C. deno start dev.ts
D. deno run -A --unstable dev.ts
Solution
Step 1: Identify the development server file in Fresh projects
Fresh projects use 'dev.ts' as the entry point to start the development server.
Step 2: Match the correct command syntax
The correct command is 'deno run -A --unstable dev.ts' to run the development server.
Final Answer:
deno run -A --unstable dev.ts -> Option D
Quick Check:
Start Fresh dev server = deno run -A --unstable dev.ts [OK]
Hint: Fresh dev server runs from dev.ts with deno run [OK]
Common Mistakes:
Trying to run main.ts which does not exist by default
Using 'deno fresh start' which is not a valid command
Omitting the -A or --unstable flags
3. After running deno run -A --unstable https://fresh.deno.dev/init myapp and changing into the myapp folder, what will happen if you run deno run -A --unstable dev.ts?
medium
A. Starts the Fresh development server and serves the app at localhost
B. Throws an error because dev.ts does not exist
C. Builds the project but does not start a server
D. Runs tests on the Fresh project
Solution
Step 1: Understand the effect of the init command
The init command creates a new Fresh project folder with all necessary files including dev.ts.
Step 2: Running dev.ts starts the development server
Running 'deno run -A --unstable dev.ts' inside the project folder launches the Fresh dev server, serving the app locally.
Final Answer:
Starts the Fresh development server and serves the app at localhost -> Option A
Quick Check:
Running dev.ts in Fresh project = starts dev server [OK]
Hint: dev.ts runs the server after init creates the project [OK]
Common Mistakes:
Assuming dev.ts is missing after init
Thinking dev.ts only builds without serving
Confusing dev.ts with test scripts
4. You ran deno run -A --unstable https://fresh.deno.dev/init myapp but got an error: error: Cannot resolve module. What is the most likely cause?
medium
A. You have no internet connection to fetch the init script
B. You forgot to include the -A permission flag
C. You ran the command inside an existing Fresh project folder
D. You used an invalid project name with spaces
Solution
Step 1: Understand the error meaning
'Cannot resolve module' means Deno cannot download the script from the URL.
Step 2: Identify common causes
This usually happens if there is no internet connection or the URL is unreachable.
Final Answer:
You have no internet connection to fetch the init script -> Option A
Quick Check:
Module fetch error = no internet connection [OK]
Hint: Check internet if module fetch fails during init [OK]
Common Mistakes:
Assuming permission flags cause module resolution errors
Thinking running inside project folder causes this error
Ignoring invalid project name as cause
5. You want to create a Fresh project named blog and start the development server. Which sequence of commands is correct?
hard
A. deno run -A https://fresh.deno.dev/init blog && cd blog && deno run dev.ts
B. deno fresh init blog && cd blog && deno start dev.ts
C. deno run -A --unstable https://fresh.deno.dev/init blog && cd blog && deno run -A --unstable dev.ts
D. deno create fresh blog && cd blog && deno run -A dev.ts
Solution
Step 1: Use the correct Fresh init command
The correct command to create a Fresh project is 'deno run -A --unstable https://fresh.deno.dev/init blog'.
Step 2: Change directory and start the dev server
After creation, change into the 'blog' folder and run 'deno run -A --unstable dev.ts' to start the server.
Final Answer:
deno run -A --unstable https://fresh.deno.dev/init blog && cd blog && deno run -A --unstable dev.ts -> Option C
Quick Check:
Init + cd + dev.ts run = deno run -A --unstable https://fresh.deno.dev/init blog && cd blog && deno run -A --unstable dev.ts [OK]
Hint: Init with URL, cd, then run dev.ts with flags [OK]
Common Mistakes:
Using 'deno fresh init' which is invalid
Omitting --unstable flag
Not changing directory before running dev.ts
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.