From 36214f024ab006ad265ac1215b801ca5acf3dccd Mon Sep 17 00:00:00 2001 From: wood chen Date: Sat, 8 Feb 2025 01:32:40 +0800 Subject: [PATCH] Update Deno configuration and import statements to use full URLs --- deno.json | 11 ++--------- import_map.json | 5 +++++ main.ts | 7 +++---- 3 files changed, 10 insertions(+), 13 deletions(-) create mode 100644 import_map.json diff --git a/deno.json b/deno.json index ed9dd12..ed9b22e 100644 --- a/deno.json +++ b/deno.json @@ -1,13 +1,6 @@ { - "compilerOptions": { - "allowJs": true, - "lib": ["deno.window"], - "strict": true - }, - "importMap": { - "imports": { - "std/": "https://deno.land/std@0.220.1/" - } + "imports": { + "std/": "https://deno.land/std@0.220.1/" }, "tasks": { "start": "deno run --allow-net --allow-env --allow-read main.ts", diff --git a/import_map.json b/import_map.json new file mode 100644 index 0000000..254df07 --- /dev/null +++ b/import_map.json @@ -0,0 +1,5 @@ +{ + "imports": { + "std/": "https://deno.land/std@0.220.1/" + } +} \ No newline at end of file diff --git a/main.ts b/main.ts index a761441..10ec551 100644 --- a/main.ts +++ b/main.ts @@ -1,7 +1,6 @@ -import { serve } from "std/http/server.ts"; -import { crypto } from "std/crypto/mod.ts"; -import { encode as base64Encode, decode as base64Decode } from "std/encoding/base64.ts"; -import { createHmac } from "crypto"; +import { serve } from "https://deno.land/std@0.220.1/http/server.ts"; +import { crypto } from "https://deno.land/std@0.220.1/crypto/mod.ts"; +import { encode as base64Encode, decode as base64Decode } from "https://deno.land/std@0.220.1/encoding/base64.ts"; // 类型定义 interface Vendor {