2 Commits

Author SHA1 Message Date
imsyy
d5217c3dff 🔧 build: 修正类型错误 2024-06-12 17:37:37 +08:00
imsyy
e1beb5b534 🐞 fix: 修复 hellogithub #60 2024-06-11 09:19:41 +08:00
5 changed files with 9 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "dailyhot-api",
"version": "2.0.0",
"version": "2.0.1",
"description": "An Api on Today's Hot list",
"keywords": [
"API",

View File

@@ -4,7 +4,7 @@ import logger from "./utils/logger.js";
import app from "./app.js";
// 启动服务器
const serveHotApi = (port: number = config.PORT) => {
const serveHotApi: (port?: number) => void = (port: number = config.PORT) => {
try {
const apiServer = serve({
fetch: app.fetch,

View File

@@ -4,7 +4,7 @@ import { get } from "../utils/getData.js";
import getTime from "../utils/getTime.js";
export const handleRoute = async (c: ListContext, noCache: boolean) => {
const sort = c.req.query("sort") || "hot";
const sort = c.req.query("sort") || "featured";
const { fromCache, data, updateTime } = await getList({ sort }, noCache);
const routeData: RouterData = {
name: "hellogithub",
@@ -15,8 +15,8 @@ export const handleRoute = async (c: ListContext, noCache: boolean) => {
sort: {
name: "排行榜分区",
type: {
hot: "热门",
last: "最新",
featured: "精选",
all: "全部",
},
},
},

5
src/types.d.ts vendored
View File

@@ -62,7 +62,4 @@ export type Web = {
// 参数类型
export type Options = {
[key: string]: string | undefined;
};
// serveHotApi
export default function serveHotApi(port?: number): unknown;
};

View File

@@ -3,11 +3,13 @@
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"declaration": true,
"declarationMap": true,
"strict": false,
"types": ["node"],
"jsx": "react-jsx",
"jsxImportSource": "hono/jsx",
"outDir": "./dist"
},
"exclude": ["node_modules", "*.test.*"]
"exclude": ["node_modules", "*.test.*", "./dist/**/*"]
}