mirror of
https://github.com/imsyy/DailyHotApi.git
synced 2026-01-12 21:24:55 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5217c3dff | ||
|
|
e1beb5b534 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dailyhot-api",
|
"name": "dailyhot-api",
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"description": "An Api on Today's Hot list",
|
"description": "An Api on Today's Hot list",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"API",
|
"API",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import logger from "./utils/logger.js";
|
|||||||
import app from "./app.js";
|
import app from "./app.js";
|
||||||
|
|
||||||
// 启动服务器
|
// 启动服务器
|
||||||
const serveHotApi = (port: number = config.PORT) => {
|
const serveHotApi: (port?: number) => void = (port: number = config.PORT) => {
|
||||||
try {
|
try {
|
||||||
const apiServer = serve({
|
const apiServer = serve({
|
||||||
fetch: app.fetch,
|
fetch: app.fetch,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { get } from "../utils/getData.js";
|
|||||||
import getTime from "../utils/getTime.js";
|
import getTime from "../utils/getTime.js";
|
||||||
|
|
||||||
export const handleRoute = async (c: ListContext, noCache: boolean) => {
|
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 { fromCache, data, updateTime } = await getList({ sort }, noCache);
|
||||||
const routeData: RouterData = {
|
const routeData: RouterData = {
|
||||||
name: "hellogithub",
|
name: "hellogithub",
|
||||||
@@ -15,8 +15,8 @@ export const handleRoute = async (c: ListContext, noCache: boolean) => {
|
|||||||
sort: {
|
sort: {
|
||||||
name: "排行榜分区",
|
name: "排行榜分区",
|
||||||
type: {
|
type: {
|
||||||
hot: "热门",
|
featured: "精选",
|
||||||
last: "最新",
|
all: "全部",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
5
src/types.d.ts
vendored
5
src/types.d.ts
vendored
@@ -62,7 +62,4 @@ export type Web = {
|
|||||||
// 参数类型
|
// 参数类型
|
||||||
export type Options = {
|
export type Options = {
|
||||||
[key: string]: string | undefined;
|
[key: string]: string | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
// serveHotApi
|
|
||||||
export default function serveHotApi(port?: number): unknown;
|
|
||||||
@@ -3,11 +3,13 @@
|
|||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "Bundler",
|
"moduleResolution": "Bundler",
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": true,
|
||||||
"strict": false,
|
"strict": false,
|
||||||
"types": ["node"],
|
"types": ["node"],
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"jsxImportSource": "hono/jsx",
|
"jsxImportSource": "hono/jsx",
|
||||||
"outDir": "./dist"
|
"outDir": "./dist"
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "*.test.*"]
|
"exclude": ["node_modules", "*.test.*", "./dist/**/*"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user