feat: add server entry point
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { loadConfig } from './config.js';
|
||||
import { getPool } from './db.js';
|
||||
import { ensureStorageDirs } from './storage.js';
|
||||
import { createApp } from './app.js';
|
||||
|
||||
async function main() {
|
||||
const config = loadConfig();
|
||||
await ensureStorageDirs(config);
|
||||
const pool = getPool(config);
|
||||
const app = createApp(config, pool);
|
||||
|
||||
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);
|
||||
});
|
||||
Reference in New Issue
Block a user