feat: add vercel entrance
This commit is contained in:
parent
b2aa636886
commit
9169e5fe9b
|
|
@ -1,14 +0,0 @@
|
|||
const path = require('path');
|
||||
const moduleAlias = require('module-alias');
|
||||
moduleAlias.addAlias('@', path.join(__dirname, '../lib'));
|
||||
|
||||
const config = require('../lib/config');
|
||||
config.set({
|
||||
NO_LOGFILES: true,
|
||||
});
|
||||
|
||||
const app = require('../lib/app');
|
||||
|
||||
module.exports = (req, res) => {
|
||||
app.callback()(req, res);
|
||||
};
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import { handle } from 'hono/vercel';
|
||||
import app from '@/app';
|
||||
import logger from '@/utils/logger';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
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);
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"framework": null,
|
||||
"github": { "silent": true },
|
||||
"routes": [{ "src": "/.*", "dest": "/api/vercel.js" }]
|
||||
"routes": [{ "src": "/.*", "dest": "/lib/vercel.ts" }]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue