feat: add server entry point
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node src/app.js",
|
"start": "node src/server.js",
|
||||||
"worker": "node src/worker.js",
|
"worker": "node src/worker.js",
|
||||||
"cleanup": "node src/cleanup.js",
|
"cleanup": "node src/cleanup.js",
|
||||||
"test": "vitest run"
|
"test": "vitest run"
|
||||||
|
|||||||
@@ -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