You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
532 B

import express from 'express';
import Manager from './Manager.js';
const app = express();
const appManager = new Manager();
app.get('/api/lastmatch', async function(req, res) {
if (!req.query.name) {
return res.status(400).send();
}
try {
const results = await appManager.getInfo(req.query.name);
res.send(results);
} catch (e) {
console.error(e);
return res.status(503).send();
}
});
app.listen('80', async function() {
console.log(`server listening on 80`);
});