Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let login = {
- user: "",
- password: ""
- };
- const response = {
- kurwy: "Whore",
- wino: "Vine",
- pianino: "Piano"
- };
- module.exports = app => {
- app.get("/kurwy", (req, res, next) => {
- if (req.auth.user === login.user && req.auth.password === login.password) {
- res.send(response.kurwy);
- }
- });
- module.exports = app => {
- app.get("/wino", (req, res, next) => {
- if (req.auth.user === login.user && req.auth.password === login.password) {
- res.send(response.wino);
- }
- });
- module.exports = app => {
- app.get("/pianino", (req, res, next) => {
- if (req.auth.user === login.user && req.auth.password === login.password) {
- res.send(response.pianino);
- }
- });
- app.get("/login", (req, res, next) => {
- if (req.auth.user === "admin" && req.auth.password === "admin") {
- login = req.auth;
- res.send("User Logged");
- }
- });
- }}};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement