mirror of
https://github.com/schroinerxy/cloud-mail.git
synced 2026-06-21 19:35:50 +08:00
25 lines
679 B
JavaScript
25 lines
679 B
JavaScript
import app from './hono/webs';
|
|
import { email } from './email/email';
|
|
import userService from './service/user-service';
|
|
import verifyRecord from './entity/verify-record';
|
|
import verifyRecordService from './service/verify-record-service';
|
|
export default {
|
|
async fetch(req, env, ctx) {
|
|
const url = new URL(req.url)
|
|
|
|
|
|
if (url.pathname.startsWith('/api/')) {
|
|
url.pathname = url.pathname.replace('/api', '')
|
|
req = new Request(url.toString(), req)
|
|
return app.fetch(req, env, ctx);
|
|
}
|
|
|
|
return env.assets.fetch(req);
|
|
},
|
|
email: email,
|
|
async scheduled(c, env, ctx) {
|
|
await verifyRecordService.clearRecord({env})
|
|
await userService.resetDaySendCount({ env })
|
|
},
|
|
};
|