kopia lustrzana https://github.com/manuelkasper/sotlas-api
Porównaj commity
3 Commity
deb80e6f6f
...
38d9e4788c
Autor | SHA1 | Data |
---|---|---|
Manuel Kasper | 38d9e4788c | |
Manuel Kasper | 8f4e61c1eb | |
Manuel Kasper | 2dd49d86a1 |
|
@ -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();
|
||||
|
|
11
server.js
11
server.js
|
@ -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);
|
||||
|
|
Ładowanie…
Reference in New Issue