import express from "express";
import { EnkaNetwork } from "enkanetwork";
const app = express();
const port = 80;
const enka = new EnkaNetwork();
app.get("/:language/:uid", async (req, res) => {
const { language, uid } = req.params;
try {
const data = await enka.fetchUser(uid, language);
return res.json(data);
} catch (err) {
return res.status(500).json({
message: err.message,
});
}
});
await enka.assetsUpdater.fetchAssets();
app.listen(port, () =>
console.log(`[SERVER] Server listening on port ${port}`)
);