Complete the code to import the configuration file in Deno.
import config from './config.[1]';
In Deno, configuration files can be TypeScript files. So the correct extension is .ts.
Complete the code to read environment variables in Deno.
const port = Deno.env.get('[1]');
Environment variables are case-sensitive and usually uppercase. The common name for the port variable is PORT.
Fix the error in the code to import a JSON config file with assertion in Deno.
import config from './config.json' [1];
Deno requires an import assertion for JSON files. The correct syntax is assert { type: 'json' }.
Fill both blanks to create a config object with default values using environment variables.
const config = {
port: Number(Deno.env.get('[1]')) || [2],
};The environment variable PORT is read and converted to a number. If not set, it defaults to 3000.
Fill all three blanks to export a configuration object with environment variables and default values.
export const config = {
host: Deno.env.get('[1]') || '[2]',
port: Number(Deno.env.get('[3]')) || 4000,
};The host uses environment variable HOST or defaults to localhost. The port uses PORT or defaults to 4000.
