Console errors node/express project


#1

Added my project today and noticed some console errors, I tried fixing them myself and hunting through the faq but couldn’t seem to fix them eventually.

Glitch doesn’t seem to like my style.css, is there some additional config to make it accept?

Also I am getting a lot of 429 errors which apparently is me requesting the file too many times. I think I only requested a couple of times from the server, and then it does not get loaded by the client index.html file anymore.

Are other people getting these types of errors?

I am not able to load in the needed javascript to run the front end. Am I loading these javascript files wrong perhaps?

In my server.js it is serving the view like this:
app.get(’/’, (request, response) => {
response.sendFile(__dirname + ‘/views/index.html’);
});
Pretty much a copy paste from the express template.


#2

Since your project is private, we can’t view the code. Either make it public temporarily or DM me a join link so we can view the code. Thanks.


#3

Hey man, sorry, I’ve marked it as public, sorry was just playing with the different buttons seeing what they were doing.

Let me know if take a look, thanks =)


#4

I think the content type errors are a red herring, as the files on the file system don’t have the MIME type it’s saying. I think it’s getting a 429 error back and is referring to that.

Projects are limited to 4000 requests per hour, with a burst of 4000 requests. Subsequent requests will return a 429 “Too Many Requests” response. So if you fix up the request limiting, then both issues should be resolved.


#5

Thanks for your help =)

That’s sorted now, adjusted the limit and no more 429 errors!

app.use(rateLimit({
windowMs: 10 * 1000, // 10 seconds
max: 100
}));

Express also needs this to serve static content from the public folder as I was getting 404 errors after fixing the rate limit.

app.use(express.static(__dirname + ‘/public’));