Sindbad~EG File Manager
const fetch = require("node-fetch");
const getBack4MakeYear = async (req, res) => {
const response = await fetch(
"https://parseapi.back4app.com/classes/Car_Model_List?limit=200&keys=Year",
{
headers: {
"X-Parse-Application-Id": "hlhoNKjOvEhqzcVAJ1lxjicJLZNVv36GdbboZj3Z", // This is the fake app's application id
"X-Parse-Master-Key": "SNMJJF0CZZhTPhLDIqGhTlUNV9r60M2Z5spyWfXW", // This is the fake app's readonly master key
},
}
);
const data = await response.json(); // Here you have the data that you need
return res.json(data.results);
// console.log(JSON.stringify(data, null, 2));
};
const getBack4MakeByYear = async (req, res) => {
const where = encodeURIComponent(
JSON.stringify({
Year: req.body.year,
})
);
const response = await fetch(
// `https://parseapi.back4app.com/classes/Carmodels_Car_Model_List?excludeKeys=Category&where=${where}`,
`https://parseapi.back4app.com/classes/Carmodels_Car_Model_List?limit=500&keys=Make&where=${where}`,
{
headers: {
"X-Parse-Application-Id": "JxfQ24gRftYvOP5eSamTlGxRlPj1APU1ahqzhMz5", // This is your app's application id
"X-Parse-REST-API-Key": "QVd0BszmciBzA0n8dQRV8zJGs2QZi50CzoEuBIXQ", // This is your app's REST API key
},
}
);
const data = await response.json(); // Here you have the data that you need
const makes = data.results.map((item) => item.Make);
const uniqueMakes = [...new Set(makes)];
return res.json({ status: 200, data: uniqueMakes });
};
const getBack4ModelsByMake = async (req, res) => {
const where = encodeURIComponent(
JSON.stringify({
Make: req.body.make,
Year: req.body.year,
})
);
const response = await fetch(
`https://parseapi.back4app.com/classes/Carmodels_Car_Model_List?limit=1000&keys=Model&where=${where}`,
{
headers: {
"X-Parse-Application-Id": "JxfQ24gRftYvOP5eSamTlGxRlPj1APU1ahqzhMz5", // This is your app's application id
"X-Parse-REST-API-Key": "QVd0BszmciBzA0n8dQRV8zJGs2QZi50CzoEuBIXQ", // This is your app's REST API key
},
}
);
const data = await response.json(); // Here you have the data that you need
// return res.json(data.results);
const models = data.results.map((item) => item.Model);
const uniqueModels = [...new Set(models)];
return res.json({ status: 200, data: uniqueModels });
};
module.exports = { getBack4MakeByYear, getBack4ModelsByMake, getBack4MakeYear };
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists