Skip to content

Commit

Permalink
fix: deno example (#33)
Browse files Browse the repository at this point in the history
* fix: deno example

* fix
  • Loading branch information
kazupon authored Oct 23, 2023
1 parent fe83ac3 commit 39bbfc6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
// ...
Expand Down
2 changes: 1 addition & 1 deletion playground/deno/deno.jsonc
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
13 changes: 7 additions & 6 deletions playground/deno/main.ts
Original file line number Diff line number Diff line change
@@ -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}`);

0 comments on commit 39bbfc6

Please sign in to comment.