-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.js
More file actions
26 lines (20 loc) · 791 Bytes
/
server.js
File metadata and controls
26 lines (20 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const express = require('express');
const bodyParser = require('body-parser');
require('dotenv').config();
const indexRoutes = require('./routes/index');
const healthCheckRoutes = require('./routes/healthCheck');
const printRoutes = require('./routes/print');
const { scheduleKeepAwake } = require('./services/scheduleKeepAwake'); // Importa la función de mantenimiento
const app = express();
app.use(bodyParser.json());
const PORT = process.env.PORT || 8080;
if (process.argv.includes('--keep-awake')) {
console.log("⏱️ Scheduled the printer keep-awake process...");
scheduleKeepAwake();
}
app.use('/', indexRoutes);
app.use('/health-check', healthCheckRoutes);
app.use('/api', printRoutes);
app.listen(PORT, () => {
console.log(`🚀 Server running on port ${PORT}`);
});