2023-05-17 16:17:45 +02:00
|
|
|
const analysis = require("./analysis");
|
2023-05-15 15:06:30 +02:00
|
|
|
|
2023-05-15 14:30:23 +02:00
|
|
|
(async () => {
|
2023-05-17 16:17:45 +02:00
|
|
|
let items = await analysis.updateData("data");
|
|
|
|
setInterval(async () => { items = await analysis.updateData("data") }, 1000 * 60 * 60 * 24);
|
|
|
|
|
2023-05-15 14:30:23 +02:00
|
|
|
const express = require('express')
|
|
|
|
const compression = require('compression');
|
|
|
|
const app = express()
|
|
|
|
const port = 3000
|
2023-05-17 16:17:45 +02:00
|
|
|
|
2023-05-15 14:30:23 +02:00
|
|
|
app.use(compression());
|
2023-05-17 16:17:45 +02:00
|
|
|
|
2023-05-15 14:30:23 +02:00
|
|
|
app.get('/api/index', (req, res) => {
|
|
|
|
res.send(items)
|
|
|
|
})
|
2023-05-16 15:56:46 +02:00
|
|
|
|
2023-05-15 14:30:23 +02:00
|
|
|
app.listen(port, () => {
|
|
|
|
console.log(`Example app listening on port ${port}`)
|
|
|
|
})
|
|
|
|
})();
|