Skip to content
Advertisement

Tag: express

How to make a workable SQL request for NodeJS file?

I have a js file to work with my local database, and a POST request is not working like it should – if I enter a specific row, it returns a correct result, but I need it to get the variable from post data. This type of entering query doesn’t work 🙁 Answer You can try to use the “Prepared

How to pass a question mark express router api to update sql

I want to update a varchar field (String) using and End-Point Api (Express NodeJS) but I have problem went I pass invalid inputs like question mark. Express End-Point: This code work fine: http://localhost:3001/api/updateField/posts/TITLE/When/1/1 But this NOT WORK: http://localhost:3001/api/updateField/posts/TITLE/When?/1/1 I send the request from react like this: Answer Use javascript function encodeURIComponent() to escape special characters in URL parameters. For example

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.

How to link Gatsby.js with my Express server

I am trying to make a very basic full-stack application where the front-end is Gatsby and the Backend is a simple Express server. I have a Database where I have some users and the goal is get these users in the backend with a query and then displaying them in the Gatsby (React) component using fetch(). Obviously something goes wrong

Advertisement