| name | deno | ||||
|---|---|---|---|---|---|
| description | Rules for using Deno | ||||
| metadata |
|
import { serve } from "https://deno.land/std@0.177.0/http/server.ts";run
deno add jsr:@std/httpdeno add npm:tailwindcssto add the import map, then
import { serve } from "@std/http/server.ts";
import { serve } from "tailwindcss";deno run --allow-net server.tsWrite a deno.json file in the root of your project:
{
"permissions": {
"default": {
"net": ["example.com", "api.example.com"],
"read": ["./data/*"],
"env": {
"ignore": true,
"allow": ["API_KEY", "DATABASE_URL"]
}
},
"build": {
"net": ["deno.land"],
"read": ["./src/*"],
"write": ["./dist/*"]
}
}
}Then run your script with the -P flags:
deno run -P server.ts
deno run -P=build build.ts