DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

D
D

Posted on

๐Ÿบ ้ฃฒใ‚“ใงdenoใ„ใ˜ใฃใฆใฟใŸ

nodejsใฎไปฃใ‚ใ‚Šใซใชใ‚‹ใฎใ‹๏ผŸ๏ผdeno(ใƒ‡ใ‚ฃใƒผใƒŽ)

$ brew install deno
$ deno -V
deno 1.0.0
Enter fullscreen mode Exit fullscreen mode

Welcome

$ deno run https://deno.land/std/examples/welcome.ts
Welcome to Deno ๐Ÿฆ•
Enter fullscreen mode Exit fullscreen mode

urlๅ…ˆ่ฆ‹ใฆใฟใ‚‹ใจ console.log("Welcome to Deno ๐Ÿฆ•");

Web server

$ vim server.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" });
}

$ deno run --allow-net server.ts
http://localhost:8000/
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

๐ŸŒš Browsing with dark mode makes you a better developer by a factor of exactly 40.

It's a scientific fact.