I currently have a worker setup for prod and staging using the Hono framework to handle backend logic such as auth/session handling/supabase db calls/etc. I’d like to use email routing to process emails sent to a custom address and then process them in one of my hono routes (that’s the general idea). My question is: should I implement the logic for email processing in the same worker or create a separate Email Worker? I currently have this setup, but I’m not entirely sure on 1. if it’ll work and 2. if it’s even best practice. I AM HERE TO LEARN
import { Hono } from 'hono'
const app = new Hono()
//...
export default {
fetch(request, env, ctx) {return app.fetch(request, env, ctx)
}
async email(message, env, ctx) {
// logic to be implemented
}