【发布时间】:2020-06-25 00:09:03
【问题描述】:
appears,当前 Deno 的 mysql 驱动程序尚不支持密码验证。我刚刚在 PHP 中完成了一个 API,并希望在 Deno 中看到一个相同的示例。
这与您从他们的网站上获得的示例一样多:
import { serve } from "https://deno.land/std@0.58.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" });
}
我在哪里添加 JSON 标头?
路由器是原生的还是必须是称为 OAK 的东西?
您是否可以在此示例中添加静态 GET、POST、PUT DELETE,在每个相应的端点返回 post.json、get.json、put.json、delete.json 文件内容?
我只是很难找到例子。
【问题讨论】: