Skip to content

Commit

Permalink
revert(js): Use default export for Bun and Workers (#72)
Browse files Browse the repository at this point in the history
JS can export as default from a module with one line.
  • Loading branch information
5ouma authored Sep 30, 2024
1 parent ced7120 commit 571ceb4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ To do this, simply add the ref name to the sub-directory.
1. Add this code to the `index.ts`

```ts
import { app } from "@5ouma/reproxy";
export default app;
export { default } from "@5ouma/reproxy";
```
2. Run these commands
Expand Down Expand Up @@ -98,8 +97,7 @@ To do this, simply add the ref name to the sub-directory.
2. Add this code to the `index.ts`
```ts
import { app } from "@5ouma/reproxy";
export default app;
export { default } from "@5ouma/reproxy";
```
3. Deploy with these commands
Expand Down
2 changes: 1 addition & 1 deletion src/server.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assertEquals } from "@std/assert";
import { STATUS_CODE } from "@std/http/status";

import { app } from "./server.ts";
import app from "./server.ts";
import {
exportRepo,
testRef,
Expand Down
3 changes: 2 additions & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import { checkRedirect, getContent, type Repository } from "./libs/mod.ts";
* });
* ```
*/
export const app: Hono = new Hono();
const app: Hono = new Hono();
export default app;
app.use(logger());
app
.get("/:ref?", async (ctx: Context) => {
Expand Down

0 comments on commit 571ceb4

Please sign in to comment.