Porównaj commity

...

3 Commity

Autor SHA1 Wiadomość Data
Manuel Kasper 38d9e4788c Track map session type too 2024-02-21 12:11:18 +01:00
Manuel Kasper 8f4e61c1eb Add method for tracking number of map sessions (to evaluate move to MapTiler Cloud) 2024-02-21 11:36:12 +01:00
Manuel Kasper 2dd49d86a1 Switch activator import to api-db2 2024-02-21 11:23:29 +01:00
2 zmienionych plików z 12 dodań i 1 usunięć

Wyświetl plik

@ -12,7 +12,7 @@ client.connect(err => {
});
async function importActivators(db) {
let response = await axios.get('https://api-db.sota.org.uk/admin/activator_roll?associationID=-1')
let response = await axios.get('https://api-db2.sota.org.uk/rolls/activator/-1/0/all/all')
// Weed out duplicate callsigns, keeping only the record with the higher number of points
let activators = new Map();

Wyświetl plik

@ -18,6 +18,7 @@ const photos_router = require('./photos_router');
const solardata = require('./solardata');
const maxmind = require('maxmind');
const cronjobs = require('./cronjobs');
const moment = require('moment');
let geoLookup;
import('geolite2-redist').then((geolite2) => {
@ -340,4 +341,14 @@ app.get('/my_country', (req, res) => {
}
});
app.post('/mapsession', (req, res) => {
let type = req.body.type;
if (!type) {
type = 'unknown';
}
let date = moment().format('YYYY-MM-DD');
db.getDb().collection('mapsessions').updateOne({date, type}, {"$inc": {"count": 1}}, {upsert: true});
res.json({});
});
app.listen(config.http.port, config.http.host);