Files
Jellystat/backend/server.js
Thegan Govender 582a39918e full change to statistics
1) Created components for statistic reporting.
2) Database changes and PROC/Function creations. Still need to make MOST VIEWED LIBRARIES/CLIENTS/ MOST ACTIVE USERS dynamically load with date range (Function Creation on DB side)
2023-03-19 22:01:40 +02:00

23 lines
759 B
JavaScript

// server.js
const express = require('express');
const cors = require('cors');
const apiRouter = require('./api');
const syncRouter = require('./sync');
const statsRouter = require('./stats');
const ActivityMonitor=require('./watchdog/ActivityMonitor');
ActivityMonitor.ActivityMonitor(1000);
const app = express();
const PORT = process.env.PORT || 3003;
const LISTEN_IP = '127.0.0.1';
app.use(express.json()); // middleware to parse JSON request bodies
app.use(cors());
app.use('/api', apiRouter); // mount the API router at /api
app.use('/sync', syncRouter); // mount the API router at /sync
app.use('/stats', statsRouter); // mount the API router at /stats
app.listen(PORT, () => {
console.log(`Server listening on http://${LISTEN_IP}:${PORT}`);
});