Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
fix(frontend): Use pre-hard-coded value for Hono RPC
Browse files Browse the repository at this point in the history
It's impossible to use relative URL path due to SSR.
  • Loading branch information
5ouma committed Sep 5, 2024
1 parent 36368a7 commit 988b43b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"fmt": { "exclude": ["LICENSE", ".github/**/*.md"] },
"tasks": {
"run": "deno run --allow-read='./public/,./private/cocktails.jsonc' --allow-net='0.0.0.0' --unstable-kv",
"run": "deno run --allow-env='API_URL' --allow-read='./public/,./private/cocktails.jsonc' --allow-net='0.0.0.0' --unstable-kv",
"start": "deno task run src/server.ts",
"dev": "deno task run --watch src/server.ts",
"test": "deno test --allow-read='./public/,./private/cocktails.jsonc' --allow-net='0.0.0.0' --unstable-kv --parallel --shuffle"
Expand Down
7 changes: 4 additions & 3 deletions src/components/utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { hc } from "@hono/hono/client";

import { API } from "../api/mod.ts";
import { Cocktail } from "../api/utils/types.ts";
import type { API } from "../api/mod.ts";
import { Cocktail, Message } from "../api/utils/types.ts";

const client = hc<API>("http://0.0.0.0:8000/api");
const url: string = Deno.env.get("API_URL") || "http://0.0.0.0:8000";
const client = hc<API>(`${url}/api`);

/**
* Get cocktails from the server
Expand Down

0 comments on commit 988b43b

Please sign in to comment.