mirror of
https://github.com/alexankitty/Myrient-Search-Engine.git
synced 2026-01-15 16:33:15 -03:00
Emulators page and json database
This commit is contained in:
12
server.js
12
server.js
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user