Emulators page and json database

This commit is contained in:
2025-03-13 15:15:38 -03:00
parent 1a3d77f3fd
commit f5641989ab
4 changed files with 656 additions and 0 deletions

View File

@@ -17,9 +17,11 @@ import { initElasticsearch } from './lib/services/elasticsearch.js';
let categoryListPath = "./lib/categories.json"
let searchAlikesPath = './lib/searchalikes.json'
let nonGameTermsPath = './lib/nonGameTerms.json'
let emulatorsPath = './lib/emulators.json'
let categoryList = await FileHandler.parseJsonFile(categoryListPath);
global.searchAlikes = await FileHandler.parseJsonFile(searchAlikesPath)
let nonGameTerms = await FileHandler.parseJsonFile(nonGameTermsPath);
let emulatorsData = await FileHandler.parseJsonFile(emulatorsPath);
let crawlTime = 0;
let queryCount = 0;
let fileCount = 0;
@@ -290,6 +292,16 @@ app.get("/proxy-bios", async function (req, res) {
}
});
app.get("/emulators", function (req, res) {
let page = "emulators";
let options = { emulators: emulatorsData };
res.render(indexPage, buildOptions(page, options));
});
app.get("/api/emulators", function (req, res) {
res.json(emulatorsData);
});
server.listen(process.env.PORT, process.env.BIND_ADDRESS);
server.on("listening", function () {
console.log(