视频讲解
https://www.bilibili.com/video/BV1qK4y1x7VG/
在开发过程中,经常遇到DNS解析域名错误的问题。导致js依赖包没法下载
我们一起来完成以下步骤:
- 先来发现问题
- 域名是否能访问?
- 解析域名(https://www.ipaddress.com/)的IP。在没有使用翻墙 情况下是否能ping通
- 修改Hosts文件(C:\Windows\System32\drivers\etc)
- 再重新run一下应用
main.ts
import { Application, Router } from "https://deno.land/x/oak/mod.ts";
const router = new Router();
const app = new Application();
router.get("/",(ctx) =>{
ctx.response.body="Hello World ";
})
app.use(router.routes());
app.use(router.allowedMethods());
await app.listen({ port:8000 });
完
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。