brew install deno
↓のをhoge.ts
import { serve } from "https://deno.land/std@0.50.0/http/server.ts"; const s = serve({ port: 8000 }); console.log("http://localhost:8000/"); for await (const req of s) { req.respond({ body: "Hello World\n" }); }
error: Uncaught PermissionDenied: network access to "0.0.0.0:8000", run again with the --allow-net flag
っておこられる
こうする
sudo deno run --allow-net hoge.ts
- 作者:Mario Casciaro,Luciano Mammino
- 発売日: 2019/05/18
- メディア: 単行本(ソフトカバー)