Complete the code to import the standard HTTP server module in Deno.
import { serve } from "https://deno.land/std/http/server.ts"[1]
In Deno, import statements end with a semicolon ; just like in JavaScript.
Complete the code to start a simple HTTP server in Deno.
serve(() => new Response("Hello from Deno!"))[1]
.listen().The serve function in Deno's standard library is called directly with parentheses to start the server.
Fix the error in the import statement to use Deno's URL imports instead of Node.js style.
import express from '[1]';
Deno uses URL imports for modules, so you must import from a full URL like https://deno.land/x/express.
Fill both blanks to convert a Node.js callback style function to a Deno async function.
async function readFile() {
const data = await Deno.[1]("file.txt", { [2]: "utf8" });
return data;
}format instead of encoding.Deno provides readTextFile for reading text files asynchronously with an encoding option.
Fill all three blanks to rewrite a Node.js environment variable access to Deno style.
const port = Deno.[1].[2]([3]) || 8080;
process.env.PORT like in Node.js.In Deno, environment variables are accessed via Deno.env.get("VAR_NAME"). Unlike Node.js, there is no process object.
