const loader = require('../../models/loader');
const helper = require('../../helper');
const express = require("express");
//const bodyParser = require("body-parser");
const router = express.Router();
const config = require("../../config")
//var jsonParser = bodyParser.json()
//var urlencodedParser = bodyParser.urlencoded({ extended: false })
const app = express();
app.use(express.json());

router.post("/loader", async (req, res, next) => {
   if(helper.check_headers(req) == "True"){
      var spinner = await  loader.get_loader();
      spinner.spinner = config.baxter_url+"images/logo/"+spinner.spinner
      res.status(200).json({
         message: "Successfull",
         status: "True",
         data:{spinner}
     });
  }else{
     res.status(200).json({
         message: "Unauthorised request",
         status: "Fail"
     });
  }
});

module.exports = router;