Skip to content

Commit

Permalink
try2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sg108 committed May 12, 2023
1 parent 3a86ded commit 6cca036
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@ const orderRoute = require("./routes/order")
const paymentRoute = require("./routes/payment")
const cors = require("cors")


app.set('trust proxy', 1);
app.use(cors({
origin:'https://homekart.azurewebsites.net',
credentials:true
}))
app.use(express.json())


app.use(function(req, res, next) {
if(req.headers['x-arr-ssl'] && !req.headers['x-forwarded-proto']) {
req.headers['x-forwarded-proto'] = 'https';
}
return next();
});
mongoose
.connect(process.env.MONGO_URL)
.then(() => console.log("Database Connected"))
Expand Down

0 comments on commit 6cca036

Please sign in to comment.