Skip to content

Commit

Permalink
chore: fit deno
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovler-Young committed Dec 24, 2024
1 parent 44949a7 commit ac307ed
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
9 changes: 9 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { Hono } from 'hono'
import { getVideoInfoApi, batchGetVideoInfo } from './src/BilibiliApi'
import { TaskResponse, BiliResponse, BackendResponse } from './src/types'
import { app } from './src/index'
import { app } from './src/index.ts'

// const app = new Hono()

app.get('/', (c) => {
return c.text('Hello Hono!')
})

Deno.serve(app.fetch)
Deno.serve({ port: 8787 },app.fetch)
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Hono } from "hono";
import { getVideoInfoApi, batchGetVideoInfo } from "./BilibiliApi";
import { TaskResponse, BiliResponse, BackendResponse } from "./types";
import { getVideoInfoApi, batchGetVideoInfo } from "./BilibiliApi.ts";
import { TaskResponse, BiliResponse, BackendResponse } from "./types.ts";

function getAPIBASE() {
return Deno.env.get("APIBASE") || "http://localhost:3000";
return Deno.env.get("APIBASE") || "http://localhost:8000";
}

const app = new Hono();
Expand Down Expand Up @@ -85,6 +85,7 @@ async function processVideoTasks(apibase: string, aids: number[]) {

app.get("/", async (c) => {
const apibase = getAPIBASE();
console.log("Fetching base API:", apibase);

try {
const data = await fetch(`${apibase}`);
Expand Down

0 comments on commit ac307ed

Please sign in to comment.