Skip to content

Commit

Permalink
feat(hono): Use deno serve for compatibility (#82)
Browse files Browse the repository at this point in the history
It doesn't need local network access, and the code becomes clean.
  • Loading branch information
5ouma authored Oct 11, 2024
1 parent 98d4eaf commit 1bbd450
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ To do this, simply add the ref name to the sub-directory.

<br /><br />

## 🔧 Setup
## 📊 Usage

### 💻 On Local

Expand All @@ -51,7 +51,7 @@ To do this, simply add the ref name to the sub-directory.
1. Run this command

```sh
deno run -A --env-file='.env' jsr:@5ouma/reproxy
deno serve -A --env-file='.env' jsr:@5ouma/reproxy
```

- [🍞 Bun](https://bun.sh)
Expand All @@ -78,7 +78,7 @@ To do this, simply add the ref name to the sub-directory.
2. Replace the default code with this
```ts
import "jsr:@5ouma/reproxy";
export { default } from "jsr:@5ouma/reproxy";
```
3. Set the environment variables
Expand Down
8 changes: 4 additions & 4 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
},
"fmt": { "exclude": ["LICENSE", "README.md", ".github/**/*.md"] },
"tasks": {
"run": "deno run --env='.env' --allow-env --allow-net='0.0.0.0,api.github.com'",
"start": "deno task run src/server.ts",
"dev": "deno task run --watch src/server.ts",
"test": "deno test --allow-env --allow-net='0.0.0.0,api.github.com' --parallel --shuffle",
"serve": "deno serve --env='.env' --allow-env --allow-net='api.github.com'",
"start": "deno task serve src/server.ts",
"dev": "deno task serve --watch src/server.ts",
"test": "deno test --allow-env --allow-net='api.github.com' --parallel --shuffle",
"cov": "deno task test --coverage && deno coverage --lcov > coverage.lcov"
},
"imports": {
Expand Down
2 changes: 0 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,3 @@ app
.get("*", (ctx: Context) => {
return ctx.redirect("/", STATUS_CODE.SeeOther);
});

if (typeof Deno !== "undefined") Deno.serve(app.fetch);

0 comments on commit 1bbd450

Please sign in to comment.