feat: vercel api use require

This commit is contained in:
DIYgod 2024-03-01 02:34:49 +08:00
parent 6cc452bf60
commit 8facd1c015
No known key found for this signature in database
1 changed files with 12 additions and 6 deletions

View File

@ -1,11 +1,17 @@
import { handle } from 'hono/vercel';
import app from '@/app';
import logger from '@/utils/logger';
const path = require('path');
const moduleAlias = require('module-alias');
moduleAlias.addAlias('@', path.join(__dirname, '../lib'));
export const runtime = 'edge';
const { setConfig } = require('../lib/config');
setConfig({
NO_LOGFILES: true,
});
const { handle } = require('hono/vercel');
const app = require('../lib/app');
const logger = require('../lib/utils/logger');
logger.info(`🎉 RSSHub is running! Cheers!`);
logger.info('💖 Can you help keep this open source project alive? Please sponsor 👉 https://docs.rsshub.app/support');
export const GET = handle(app);
export const POST = handle(app);
module.exports = handle(app);