I'm following a tutorial from youtube creating a simple dockerized CRUD application in Express, Node.js, Mongo & Redis. I stucked at video 3:06:57 on Authen
I have a simple user model with 2 hooks. User.beforeCreate(setSaltAndPass) User.beforeUpdate(setSaltAndPass) the first works perfectly but the beforeUpdate doe
I'm trying to add security to my API swagger endpont. I have created my API using node.js and express and swagger-ui-express module. The problem is that anyone
I m using express-session and memcached-connect package for maintaining session. Everything is working as expected. Here is my implementation: Middleware app
I use express for my API. I have a folder named app and another folder named server. app is the client app, using create-react-app as boilerplate, while server
I was browsing through some code examples for Express server on GitHub and came across this function used to wrap around REST API controllers and was confused h
I have an MEAN stack app and trying to upload file with multer. Upload is working fine the only problem is I want to return uploaded file's id. //multer setti
I am implementing JWT in one of my node apps. I am wondering, if there is any definite format/ structure in which a refresh token should be generated? By de
I want to know what should I use to expose my service layer for nodejs api What are the pros and cons of using the approach 1 and 2. app.post("/", (req, res) =&
What I want is, when I click SUBMIT button, it should post some data using axios.post const sb = async () => { axios.post('/tagSearch',{ qual: qual
I'm getting this error when I try to connect my app(nodejs) to mongodb. I really appreciate your help here. MongoParseError: URI does not have hostname, domain
I am passing in the following date through query string: 2020-09-23 I am trying to figure out why the below code with the doesn't work comment above it is not w
i am using mongo db to fetch and post the data but unable to post more than 1 request here is my code ON posting the different values second time i am getting t
How can I make 301 re directions from one url to another in NextJS application that is stored on Vercel? I tried to add custom express server using server.js fi
I am trying to set up user validation in Mongoose and struggling to get the specific messages to appear. Here is my model const userSchema = new Schema({ n
I am currently refactoring my code and I am hoping there is a more efficient way to make my code look pretty. Here is what I currently have: router.route('/ap
I am currently refactoring my code and I am hoping there is a more efficient way to make my code look pretty. Here is what I currently have: router.route('/ap
I have a project with two defferent folders. One is frontend the another is back-end. I want to deploy this both folders on one heroku app. In the server.js i h
I'm trying to create an error-handling middleware, and as you can see in the image attached when I'm making the app.use((err,req,res,next) => {...}) block
I want to know the best practice behind logging my node application. I was reading the 12 factor app guidelines at https://12factor.net/logs and it states that