Skip to content

Tag: static

MIME type error with express.static and CSS files

I’m using Express and NodeJS. In my server.js file I have this piece of code: And subsequently in my static directory, I have a CSS folder, and then a style.css file. In my index.html, I link to the sheet like so: However, in my test environment I continue to get this error: Refused to apply style from ‘http://localhost:3500/static/css/style.css’ because its

JS call static method from class

I have a class with a static method: Is there an equivalent to this for static methods (i.e. refer to the current class without an instance)? So I don’t have to write the class name: “User”. Answer From MDN documentation Static method calls are made directly on the class and are not callable on instances of the class. Static methods