Skip to content

Commit 0af635e

Browse files
committed
add the amazon website status
1 parent bc1056a commit 0af635e

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# amazon
2-
Amazon for deno
2+
Amazon for deno:
3+
- check if amazon website is online
4+
5+
```ts
6+
import { Amazon } from "https://deno.land/x/amazon"
7+
```

main.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

mod.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export class Amazon {
2+
public async isOnline(){
3+
try {
4+
let req = await fetch('https://www.amazon.com/');
5+
if (req.status === 200) {
6+
return true;
7+
}
8+
} catch (error) {}
9+
return false;
10+
}
11+
}

0 commit comments

Comments
 (0)