mirror of
https://github.com/LogicLabs-OU/OpenArchiver.git
synced 2026-04-06 00:31:57 +02:00
27 lines
755 B
TypeScript
27 lines
755 B
TypeScript
import { createServer, logger } from '@open-archiver/backend';
|
|
import * as dotenv from 'dotenv';
|
|
|
|
dotenv.config();
|
|
|
|
async function start() {
|
|
// --- Environment Variable Validation ---
|
|
const { PORT_BACKEND } = process.env;
|
|
|
|
if (!PORT_BACKEND) {
|
|
throw new Error(
|
|
'Missing required environment variables for the backend: PORT_BACKEND.'
|
|
);
|
|
}
|
|
// Create the server instance (passing no modules for the default OSS version)
|
|
const app = await createServer([]);
|
|
|
|
app.listen(PORT_BACKEND, () => {
|
|
logger.info({}, `✅ Open Archiver (OSS) running on port ${PORT_BACKEND}`);
|
|
});
|
|
}
|
|
|
|
start().catch(error => {
|
|
logger.error({ error }, 'Failed to start the server:', error);
|
|
process.exit(1);
|
|
});
|