跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • deno 和 dart 好像啊
未分類
27 10 月 2020

deno 和 dart 好像啊

deno 和 dart 好像啊

資深大佬 : chenhui7373 5

···

import { serve } from “https://deno.land/[email protected]/http/server.ts”;

const s = serve({ port: 8000 });

console.log(“http://localhost:8000/”);

for await (const req of s) {

req.respond({ body: “Hello Worldn” });

}

···

······

import ‘dart:io’;

Future main() async {

var server = await HttpServer.bind(

InternetAddress.loopbackIPv4,  8000); 

print(‘Listening on localhost:${server.port}’);

await for (HttpRequest request in server) {

request.response.write('Hello worldn');  await request.response.close(); 

}

}

······

大佬有話說 (0)

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具