视频讲解
https://www.bilibili.com/video/BV1qK4y1x7VG/
在开发过程中,经常遇到DNS解析域名错误的问题。导致js依赖包没法下载
我们一起来完成以下步骤:
- 先来发现问题
- 域名是否能访问?
- 解析域名(https://www.ipaddress.com/)的IP。在没有使用 openssl 等软件情况下是否能ping通
- 修改Hosts文件(C:WindowsSystem32driversetc)
- 再重新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 });
完