mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-08-29 01:53:47 +08:00
be1620074f
* feat: expose server URL in the CLI * style: use arraw function ---------
23 lines
700 B
TypeScript
23 lines
700 B
TypeScript
import { serve } from '@hono/node-server';
|
|
import logger from '@/utils/logger';
|
|
import { getLocalhostAddress } from '@/utils/common-utils';
|
|
import { config } from '@/config';
|
|
import app from '@/app';
|
|
|
|
const port = config.connect.port;
|
|
const hostIPList = getLocalhostAddress();
|
|
|
|
logger.info(`🎉 RSSHub is running on port ${port}! Cheers!`);
|
|
logger.info('💖 Can you help keep this open source project alive? Please sponsor 👉 https://docs.rsshub.app/support');
|
|
logger.info(`🔗 Local: 👉 http://localhost:${port}`);
|
|
for (const ip of hostIPList) {
|
|
logger.info(`🔗 Network: 👉 http://${ip}:${port}`);
|
|
}
|
|
|
|
const server = serve({
|
|
fetch: app.fetch,
|
|
port,
|
|
});
|
|
|
|
export default server;
|