I have a custom domain set up in Heroku which works fine. I can access my site using both my app name and custom domain. I can access a route using my standard Heroku URL, but not using the custom domain. For example: Works: Does not work: Server config: Answer I know its too late but I am writing for
Tag: express
Mongoose schema Cannot read property ‘password’ of undefined
I was trying out passport local authentication by following a tutorial. Everything seems fine but I’m getting this error when I make a request using Postman: Here is my user schema: And this is my server.js file: Here is the Passport strategy I’m using: I’ve no idea whats going wrong to be honest. please help. **Update:**The signup route and signup
Docker is not accepting proxy api server
i get the following error, when doing a docker-compose up. The app is running but cannot make any api post/get requests. The express server is using port 5000. ] [HPM] Error occurred while trying to proxy request /api/users/user from localhost:3000 to http://localhost:5000/ (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors) Despite having the react proxy set up, the error persists. setupProxy.js Dockerfile docker-compose.yml package.json Answer I
UnhandledPromiseRejectionWarning: This error originated either by throwing inside of an async function without a catch block
I am getting following error in my Node-Express App UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4) To say the least, I have created a helper function which looks something like this and then I
CORS blocks mutation in GraphQL Yoga
I am working here with a graphql prisma backend and a graphql yoga express server on top of that. In the frontend, I am trying to call a signout mutation but its blocked by the CORS policy. Though I have added cors settings in my graphql yoga server, I keep getting this error. GraphQL Queries are working fine but Mutations
How to execute multiple mongoose queries asynchronously and wait until all of them finish executing before sending response?
Thanks in advance, but could someone explain to me how can I execute a different query for each property of my request? I am trying to create a search sidebar menu, when user changes checkbox values I create an object with these properties: I want to push a query into an array of functions and then execute them using async.parallel
sequelize compare date with date-timestamp
my simple use case is I pass a date and try to compare that with the default createdAt column. and my date is a string like this date = ‘2018-12-12’ The problem here is sequlize not compare only the date. But it does add time 00:00:00 to my date and then compare. So the query sequlize generate is like this.
Node.js – Handle body-parser invalid JSON error
I’m using the body-parser package like this: When a valid input like { “foo”: “bar” } is received everything works fine and I can access the parsed object with req.body. However, when invalid (non-JSON) data is sent: I get this error: How can I handle this properly to prevent the server from shutting down? Answer One option is to add
React.js: Raw HTML string does not gets recognized as HTML elements from Node.js
I am sending a raw HTML from node.js to react. and It was successful. However, when I try to render it, they are render as raw string as opposed to HTML elements This is how I get the string from front-end: The render method from my react(Simplified) looks like this: In my server.js, i have the following code handeling the
Can Winston Logger be used on the front-end for logging?
I am creating full mean stack app with NodeJs , Angular 6 , ExpressJs and MongoDB I have managed to create a server and its working perfectly, instead of using console.log when logging errors in my app I have decided to use Winston Logger here is what I have now Server side Note: Winston in server side works perfectly Client-Side