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