Error deploying backend project
Porject id: c6e87e4d-11c8-412e-a080-be040b3c77f8
Hello everyone,
I have this error when I click on the link to consult the enpoints, I don't know how to solve it. I inspected through the console and I got that error, how can I solve it. Thank you very much to all. this is the link. https://appmoviesbackend-production.up.railway.app/
![No description](https://cdn.answeroverflow.com/1164412775003594854/Captura_desde_2023-10-18_22-10-36.png)
12 Replies
Project ID:
N/A
you need to set the applicable CSP headers, give this mdn article a read https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
I already did it, in the node.js app file and it doesn't work.
const express = require("express");
const helmet = require("helmet");
const cors = require("cors");
require("dotenv").config();
const router = require("./routes");
const errorHandler = require("./utils/errorHandler");
// Esta es nuestra aplicación
const app = express();
//
// Middlewares
app.use(express.json());
app.use(helmet({
contentSecurityPolicy: {
defaultSrc: "*",
},
}));
// app.use(helmet());
app.use(cors());
//
app.use("/api/v1", router);
app.use(errorHandler);
module.exports = app;
please enclose code in triple backticks
here
app.use(express.json());
app.use(helmet({
contentSecurityPolicy: {
defaultSrc: "*",
},
when sending code on discord enclose it in triple backticks
give the readme a read https://github.com/helmetjs/helmet/blob/main/README.md
I'll check the link and comment tomorrow. I'm tired
thats fair
thank you so much
haha I'm just sending you stuff to read