Change structure of LawinServer

This commit is contained in:
Lawin0129
2022-02-15 17:45:46 +00:00
parent acf6b1d3d6
commit 63cb770799
28 changed files with 7162 additions and 7102 deletions

27
structure/affiliate.js Normal file
View File

@@ -0,0 +1,27 @@
const Express = require("express");
const express = Express.Router();
express.get("/affiliate/api/public/affiliates/slug/:slug", async (req, res) => {
const SupportedCodes = require("./../responses/SAC.json");
var ValidCode = false;
SupportedCodes.forEach(code => {
if (req.params.slug.toLowerCase() == code.toLowerCase()) {
ValidCode = true;
return res.json({
"id": code,
"slug": code,
"displayName": code,
"status": "ACTIVE",
"verified": false
});
}
})
if (ValidCode == false) {
res.status(404);
res.json({});
}
})
module.exports = express;