From 39bbfc6cbf2bbbc8dd53f4ab8a0d8142972b29f7 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Mon, 23 Oct 2023 17:36:57 +0900 Subject: [PATCH] fix: deno example (#33) * fix: deno example * fix --- README.md | 2 +- playground/deno/deno.jsonc | 2 +- playground/deno/main.ts | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index efefce4..47105e0 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ in your HTML: * you can install via other CDN URL such as skypack, * or, you can also use import maps */ -import { isLocale } from 'https://esm.sh/@intlify/utils' +import { isLocale } from 'https://deno.land/x/intlify_utils/mod.ts' // something todo // ... diff --git a/playground/deno/deno.jsonc b/playground/deno/deno.jsonc index 8924b00..e8e12eb 100644 --- a/playground/deno/deno.jsonc +++ b/playground/deno/deno.jsonc @@ -1,6 +1,6 @@ { "imports": { - "@intlify/utils": "https://esm.sh/@intlify/utils@0.10.0" + "@intlify/utils": "https://deno.land/x/intlify_utils/mod.ts" }, "tasks": { "dev": "deno run --watch main.ts", diff --git a/playground/deno/main.ts b/playground/deno/main.ts index 8b01aec..e999fa9 100644 --- a/playground/deno/main.ts +++ b/playground/deno/main.ts @@ -1,11 +1,12 @@ // @ts-ignore: this is example -import { getHeaderLanguages } from '@intlify/utils' +import { getHeaderLanguages } from "@intlify/utils"; // module is mapped by `deno.jsonc` +// import { getHeaderLanguages } from 'https://deno.land/x/intlify_utils/mod.ts' -const port = 8125 +const port = 8125; Deno.serve({ port, }, (req: Request) => { - const languages = getHeaderLanguages(req) - return new Response(`detect accpect-language: ${languages}`) -}) -console.log(`server listening on ${port}`) + const languages = getHeaderLanguages(req); + return new Response(`detect accpect-language: ${languages}`); +}); +console.log(`server listening on ${port}`);