Skip to content

Commit

Permalink
📝 Change home page
Browse files Browse the repository at this point in the history
  • Loading branch information
zuisong committed Jan 20, 2024
1 parent 551f0bd commit 22a4a7b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
1 change: 1 addition & 0 deletions main_bun.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { app } from "./src/app.ts"
// @ts-ignore supress warning
Bun.serve({
port: 8000,
fetch: app.fetch,
Expand Down
2 changes: 1 addition & 1 deletion main_deno.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app } from "./src/app.ts"

// @ts-ignore supress idea warning
// @ts-ignore supress warning
Deno.serve({ port: 8000 }, app.fetch)
23 changes: 9 additions & 14 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,20 @@ export const app = new Hono({ strict: true })
.options("*", (c) => c.text("", 204))
.get("/", (c) => {
const origin = new URL(c.req.url).origin
return c.html(
`<pre>
return c.text(`
Hello Gemini-OpenAI-Proxy from ${getRuntimeKey()}!
You can try it with:
curl ${origin}/v1/chat/completions \\
-H "Authorization: Bearer $YOUR_GEMINI_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello"}],
"temperature": 0.7
}'
</pre>`,
)
-H "Authorization: Bearer $YOUR_GEMINI_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello"}],
"temperature": 0.7
}'
`)
})
.post("/v1/chat/completions", chatProxyHandler)

Expand Down

0 comments on commit 22a4a7b

Please sign in to comment.