import 'dotenv/config';
import { serve } from '@hono/node-server';
import initFunc from '@/src/lib/init';
import { createApp } from '@/src/app'
// import signedUrlCache from '@/src/lib/signed-url-cache';
import { seed } from '@/src/lib/seed';
import '@/src/jobs/jobs-index';
import { startAutomatedJobs } from '@/src/lib/automatedJobs';

seed()
initFunc()
startAutomatedJobs()

// signedUrlCache.loadFromDisk(); // Disabled for Workers compatibility

const app = createApp()

serve({
  fetch: app.fetch,
  port: 4000,
}, (info) => {
  console.log(`Server is running on http://localhost:${info.port}/api/mobile/`);
});
