File tree 3 files changed +11
-1
lines changed
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 24
24
25
25
``` sh
26
26
curl -fsSL https://x.deno.js.cn/install.sh | sh
27
+ export DENO_INSTALL=" /root/.deno"
28
+ export PATH=" $DENO_INSTALL /bin:$PATH "
27
29
deno run -A --unstable qrcode/index.mjs
28
30
```
Original file line number Diff line number Diff line change 1
1
import { Sono } from "jsr:@sono/core" ;
2
+ import { loadUrl } from "../load-url/index.ts" ;
2
3
const sono = new Sono ( ) ;
3
4
Deno . serve (
4
5
/**
@@ -10,7 +11,7 @@ Deno.serve(
10
11
return sono . connect ( req ) ;
11
12
}
12
13
return new Response (
13
- await Deno . readTextFile ( new URL ( "./client.html" , import . meta. url ) ) ,
14
+ await loadUrl ( new URL ( "./client.html" , import . meta. url ) ) ,
14
15
{ headers : { "content-type" : "text/html" } }
15
16
) ;
16
17
}
Original file line number Diff line number Diff line change
1
+ export const loadUrl = ( url : URL ) => {
2
+ if ( url . protocol === "file:" ) {
3
+ return Deno . readFile ( url ) ;
4
+ } else {
5
+ return fetch ( url ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
6
+ }
7
+ } ;
You can’t perform that action at this time.
0 commit comments