Task 4 rewrote src/db.js and src/jobs/jobRepository.js to use Prisma instead of the hand-rolled mariadb pool. This updates every remaining call site (app.js, server.js, worker.js, cleanup.js) and the 5 test files that still referenced getPool/closePool/pool.query, so the app and full test suite compile and run against Prisma Client. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
21 lines
563 B
JavaScript
21 lines
563 B
JavaScript
import { loadConfig } from './config.js';
|
|
import { getPrismaClient } from './db.js';
|
|
import { ensureStorageDirs } from './storage.js';
|
|
import { createApp } from './app.js';
|
|
|
|
async function main() {
|
|
const config = loadConfig();
|
|
await ensureStorageDirs(config);
|
|
const prisma = getPrismaClient(config);
|
|
const app = createApp(config, prisma);
|
|
|
|
app.listen(config.port, () => {
|
|
console.log(`File converter API listening on port ${config.port}`);
|
|
});
|
|
}
|
|
|
|
main().catch((error) => {
|
|
console.error('Failed to start server:', error);
|
|
process.exit(1);
|
|
});
|