Tell us what’s happening:
Hi,
i neither can get the Repl nor the Github Repo working. In replit i get this error message
unable to read .replit:
unable to decode .replit: toml: cannot load TOML value of type map[string]interface {} into a Go string
and on render via a Github repo clone it crashed with:
Oct 23 06:31:05 PM TypeError: Router.use() requires a middleware function but got a Object
Oct 23 06:31:05 PM at Function.use (/opt/render/project/src/node_modules/express/lib/router/index.js:469:13)
Oct 23 06:31:05 PM at Function.<anonymous> (/opt/render/project/src/node_modules/express/lib/application.js:227:21)
Oct 23 06:31:05 PM at Array.forEach (<anonymous>)
Oct 23 06:31:05 PM at Function.use (/opt/render/project/src/node_modules/express/lib/application.js:224:7)
Oct 23 06:31:05 PM at Object.<anonymous> (/opt/render/project/src/myApp.js:61:5)
Oct 23 06:31:05 PM at Module._compile (internal/modules/cjs/loader.js:1068:30)
Oct 23 06:31:05 PM at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
Oct 23 06:31:05 PM at Module.load (internal/modules/cjs/loader.js:933:32)
Oct 23 06:31:05 PM at Function.Module._load (internal/modules/cjs/loader.js:774:14)
Oct 23 06:31:05 PM at Module.require (internal/modules/cjs/loader.js:957:19)
I tried it with my solution & without any code from me but i always get these error messages. I also read the code and tried to fix it, but it turns out i cant. i just gues that theres any middleware that doesnt work correct, but FCC uses
app.disable("x-powered-by");
and
app.use(function (req, res, next) {
res.set({
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers":
"Origin, X-Requested-With, content-type, Accept",
});
app.disable("x-powered-by");
next();
});
that i dont know anything about.
Anyone have same issues or can help me?
Thanks a lot.
Your project link(s)
solution: https://replit.com/join/nvfagolqxo-minervaeu
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Challenge: Information Security with HelmetJS - Install and Require Helmet
Link to the challenge: