mirror of
https://github.com/imsyy/DailyHotApi.git
synced 2026-01-12 05:04:56 +08:00
🔧 build: fix document
This commit is contained in:
1
.npmignore
Normal file
1
.npmignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
node_modules
|
||||||
105
package.json
105
package.json
@@ -1,52 +1,53 @@
|
|||||||
{
|
{
|
||||||
"name": "dailyhot_api",
|
"name": "dailyhot-api",
|
||||||
"version": "2.0.0-rc.2",
|
"version": "2.0.0-rc.3",
|
||||||
"description": "An Api on Today's Hot list",
|
"description": "An Api on Today's Hot list",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"API",
|
"API",
|
||||||
"RSS"
|
"RSS"
|
||||||
],
|
],
|
||||||
"homepage": "https://github.com/imsyy/DailyHotApi#readme",
|
"homepage": "https://github.com/imsyy/DailyHotApi#readme",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/imsyy/DailyHotApi/issues"
|
"url": "https://github.com/imsyy/DailyHotApi/issues"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/DIYgod/RSSHub.git"
|
"url": "git+https://github.com/imsyy/DailyHotApi.git"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "imsyy",
|
"author": "imsyy",
|
||||||
"main": "src/index.ts",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"types": "dist/types.js",
|
||||||
"format": "prettier --write .",
|
"scripts": {
|
||||||
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.vue --fix",
|
"format": "prettier --write .",
|
||||||
"dev": "tsx watch --no-cache src/index.ts",
|
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.vue --fix",
|
||||||
"dev:cache": "tsx watch src/index.ts",
|
"dev": "tsx watch --no-cache src/index.ts",
|
||||||
"build": "tsc --project tsconfig.json",
|
"dev:cache": "tsx watch src/index.ts",
|
||||||
"start": "tsx src/index.ts"
|
"build": "tsc --project tsconfig.json",
|
||||||
},
|
"start": "tsx src/index.ts"
|
||||||
"type": "module",
|
},
|
||||||
"dependencies": {
|
"type": "module",
|
||||||
"@hono/node-server": "^1.9.1",
|
"dependencies": {
|
||||||
"axios": "^1.6.8",
|
"@hono/node-server": "^1.9.1",
|
||||||
"cheerio": "1.0.0-rc.12",
|
"axios": "^1.6.8",
|
||||||
"dotenv": "^16.4.5",
|
"cheerio": "1.0.0-rc.12",
|
||||||
"feed": "^4.2.2",
|
"dotenv": "^16.4.5",
|
||||||
"hono": "^4.2.2",
|
"feed": "^4.2.2",
|
||||||
"md5": "^2.3.0",
|
"hono": "^4.2.2",
|
||||||
"node-cache": "^5.1.2",
|
"md5": "^2.3.0",
|
||||||
"winston": "^3.13.0"
|
"node-cache": "^5.1.2",
|
||||||
},
|
"winston": "^3.13.0"
|
||||||
"devDependencies": {
|
},
|
||||||
"@types/node": "^20.12.5",
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
"@types/node": "^20.12.5",
|
||||||
"@typescript-eslint/parser": "^7.5.0",
|
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
||||||
"eslint": "^8.57.0",
|
"@typescript-eslint/parser": "^7.5.0",
|
||||||
"prettier": "^3.2.5",
|
"eslint": "^8.57.0",
|
||||||
"tsx": "^3.14.0",
|
"prettier": "^3.2.5",
|
||||||
"typescript": "^5.4.4"
|
"tsx": "^3.14.0",
|
||||||
},
|
"typescript": "^5.4.4"
|
||||||
"engines": {
|
},
|
||||||
"node": ">=20"
|
"engines": {
|
||||||
}
|
"node": ">=20"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
30
src/index.ts
30
src/index.ts
@@ -1,15 +1,15 @@
|
|||||||
import { serve } from "@hono/node-server";
|
import { serve } from "@hono/node-server";
|
||||||
import { config } from "./config.js";
|
import { config } from "./config.js";
|
||||||
import logger from "./utils/logger.js";
|
import logger from "./utils/logger.js";
|
||||||
import app from "./app.js";
|
import app from "./app.js";
|
||||||
|
|
||||||
// 启动服务器
|
// 启动服务器
|
||||||
const server = serve({
|
const serveHotApi = serve({
|
||||||
fetch: app.fetch,
|
fetch: app.fetch,
|
||||||
port: config.PORT,
|
port: config.PORT,
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.info(`🔥 DailyHot API 成功在端口 ${config.PORT} 上运行`);
|
logger.info(`🔥 DailyHot API 成功在端口 ${config.PORT} 上运行`);
|
||||||
logger.info(`🔗 Local: 👉 http://localhost:${config.PORT}`);
|
logger.info(`🔗 Local: 👉 http://localhost:${config.PORT}`);
|
||||||
|
|
||||||
export default server;
|
export default serveHotApi;
|
||||||
|
|||||||
Reference in New Issue
Block a user