Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

domain adding #2

Open
rahulmanjhu2 opened this issue May 27, 2022 · 0 comments
Open

domain adding #2

rahulmanjhu2 opened this issue May 27, 2022 · 0 comments

Comments

@rahulmanjhu2
Copy link

// setup routes
// const express = require("express");
// const router = express.Router();
const File = require("../model/File");

const initRoutes = (app) => {
app.get("/", function (req, res) {
res.send("Server Running");
});

app.get("/getfile", function (req, res) {
let fileName = req.query.fileName;
// console.log("File Name", fileName);
// console.log("Previous Url", req.get("referer"));
if (req.get("referer") && req.get("referer").includes("domain.com")) {
// console.log("Yes");
File.findOne({ fileName: fileName })
.then((file) => {
if (file) {
// console.log(file);
res.redirect(file.url);
} else {
res.send("File Not Found");
}
})
.catch((err) => {
console.log(err);
});
} else {
// console.log("No");
backURL = req.header("Referer") || "/";
res.redirect(backURL);
}
});
};

module.exports = initRoutes;

check this uper script I found it some other opsesourece reps bro im new in js can add this in ur script like if worker url accsend from motion donation then worker link worker otherwise worker link not works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant