Skip to content
Advertisement

Tag: express

UnhandledPromiseRejectionWarning: ValidationError

I’m running into a trouble since a few days. I’m learning the MEAN stack, but during creation of a user on mongo using mongoose schema, I have this problem : (node:93337) UnhandledPromiseRejectionWarning: ValidationError: User validation failed: username: Path username is required., password: Path password is required., email: Path email is required. Here’s my code : The server part : …

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

understanding body parameters in javascript

im having difficulty understanding how form data are taken in javascript. For example: are firstName and lastName id’s from the html used to identify what field the data is coming from? Thank you! Answer We can’t really tell based on what you posted, if it is a direct form post (and not AJAX), then the data will come from input/select

Advertisement