Files
graphs/backend/index.js
Cauê Faleiros 8c2590c56a
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m32s
refactor backend and persist stock campaign queue
2026-05-27 15:00:23 -03:00

20 lines
632 B
JavaScript

const { createApp } = require('./server');
const { initDB } = require('./db');
const { PORT } = require('./config');
const start = async () => {
await initDB();
const app = createApp();
app.listen(PORT, '0.0.0.0', () => {
console.log(`Nexstar Backend running at http://localhost:${PORT}`);
console.log(`Endpoint for n8n: POST http://localhost:${PORT}/api/data`);
console.log(`Scheduled campaign processor: POST http://localhost:${PORT}/api/internal/process-stock-campaigns`);
});
};
start().catch((error) => {
console.error('Failed to start backend:', error);
process.exit(1);
});