Category "express"

Deleting user profile Mongoose and Express

I am creating a route from back end to be able to delete a profile once its been created but Ienter image description here am getting an error from postman say

How to identify a client with nodejs/express?

I am creating a web app that offers a membership access with a trial period. However, I need to be sure the users cannot create a new account with other credent

What are "signed" cookies in connect/expressjs?

I am trying to figure out what "signed cookies" actually are. There isn't much on the net, and if I try this: app.use(express.cookieParser('A secret')); But

Prevent multiple fast clicks from triggering API

For my project a instagram-clone, I have a like and dislike button. If there are no likes or dislikes from the current logged in user, both will show black. If

session changes are losing when request ends in react and nodejs

Hi am trying to implement authentication using node js sessions in file mainLoginArea.js i am calling a function goButtonClicked which helps user to sign in by

How can I download image using GridFSBucket?

I tried everything I found on internet but nothing solved my problem. I really need help on this problem. I'm following the tutorial "How to upload/store images

Express + Typescript: How to GET Param and Body request

I route put method to this const createFaceList = (req: Request<{faceListId : string}>, res: Response, next: NextFunction) => { console.log(req.body.n

How do I make Heroku to listen to multiple ports?

I am trying to host my application on Heroku but I get the below error from the logs: Error: listen EADDRINUSE: address already in use :::27427 Apollo Server:

Why does my middleware produce an error when running get request by ID

I have just a simple API I am building for school. There is a collection of Books that are being accessed, displaying book by id, displaying all books, adding b

when i use uuid the code unexpected crash, and then works fine?

const express = require('express'); const { uuid } = require('uuidv4'); const app = express(); app.use(express.json()) const projects = []; app.post('/proj

Upload/Store multiple files with multer, i.e image and pdf with single request in nodejs

The following code works to upload a single image to upload an image and store its path in the database, now I can't find a way to upload an image and a pdf fil

Create JSON dynamically with dynamic keys and values in Express Js

I am fetching API into my Express server which has several JSON key value pairs in one array. For Example: [{ "quality": "best", "url": "https://someurlhere.e

what should be the default value of file in react-typescript in useState

How do I initialize a file through useState in React Typescript? const [images, setImages] = useState<File>(); const [formData, setFormData] = useSt

Setting a title and favicon for non-html files on a website

Is there a way to set a title and favicon for non-html files on a website? For example, a link like https://example.com/files/image-or-something.png. By default

show only one item with express/ejs/mongo

I've been trying to make a very simple ToDo list but when I want to show the description of the tasks, it displays all the descriptions, not only for that task

How to insert array to object using postman and nodejs. Send the data to mongodb

I Write My code like this but it has error, How to rewrite this code db.collection('collection_name').insertOne({ name:req.body.name, details:[{ age:req.body.ag

jwt.verify not throwing error for expired tokens

I'm using JWT - jsonwebtokens in Nodejs. I'm creating a token and want to throw an error if the token expires. My token is created successfully and I'm checking

error: missing FROM-clause entry for table "x" Express

Trying to fix up my first node/express GET request. Having some trouble getting it working though. I currently am getting this error: error: missing FROM-clause

Swagger-ui-express swagger-JsDoc error 😱 Could not render n, see the console. in NodeJS app

I have a NodeJs app using swagger-ui-express swaggerJsDoc. When expand schemas as swagger define encountered error below. What should I do ? Error server.js swa

Express routes working with url params but not with specific sub routes

I'm building an API for my web app and I was able to successfully send requests to the routes in Post.js when they only had url params. But when I try to create