Category "express"

How to return error message objects to the client in Express?

I have this block of code: router.post('/users/login', async (req, res) => { try { const { email, password } = req.body const user = await User.fi

React Native / Expo : Fetch throws “Network request failed”

I saw several posts on the subject but without result. I have on the one hand a form which collects information (name, first name etc) then saves it in database

Failed to lookup view "index.ejs" in views directory

I have the following code in my express app (app.js file): const express = require("express"); const app = express(); app.set('view engine', 'ejs'); app.get(

Calling Express Route internally from inside NodeJS

I have an ExpressJS routing for my API and I want to call it from within NodeJS var api = require('./routes/api') app.use('/api', api); and inside my ./route

Grouping routes in Express

We can group our routes like this in Laravel: Route::group("admin", ["middleware" => ["isAdmin"]], function () { Route::get("/", "AdminController@inde

several react apps with express server

The idea is to make a lot of separate react apps on the one express server, so each of them should appear using the url something like mysite.com/app1, mysite.c

Mongodb Node.js Express how should the learning ranking be and what do they do

1 - how should the learning ranking be (Mongo db,Node.js,Express) 2 - is it only available for the web or is it also available for mobile? 3 - What do they do

node.js express-unless exclude a path from middleware.auth

I am looking to use express-unless to exclude a /health path from using middleware.auth. I am having syntax issues, and I am unable to test this locally. If I

Angular-router not works at vercel

I'm working on the serverless web MEAN and I'm trying to publish on vercel. When I'm trying to access some route through the navigation menu, the router is work

Server responds with status 405

I'm running into a small issue with my "server". So while I'm trying to learn backend to frontend communication, I was messing around and trying to create an "a

how to configure webpack HMR with express

package.json scripts: "scripts": { "build": "webpack --config config/webpack.prod.config.js", "dev": "webpack --config config/webpack.dev.config.js &a

ExpressJS - Handle multiple pages/pagination

I am trying to handle multiple pages for a search with expressjs but it seems that doesn't work at all. I have the root and the query params /properties/search

How can i upload audio file to Cloudinary with Node.js?

i deeply need help with this audio file upload to cloudinary issue I have had for several days now. I tried many times to make it work, but i am still strugglin

TypeError: res.status is not a function

I'm making a function that permits me to upload a picture to imgur in my express api (nodejs), i'm encoutering an error when calling a function returning a prom

Error: ENOENT: no such file or directory, open When trying to access a directory with fs

I am not knowledgeable in nodejs or express, I have an API running on http://localhost:3000 and one of the endpoints call a function that uses file system to re

Failed to lookup view "index" in views directory

I am trying to learn node.js. I have the following code. var express = require('express'); var app = express(); var port = process.env.PORT || 5000; app.use

pm2 --ignore-watch not working

I have been using pm2 for some time now. Recently, I needed to add a custom log directory to my Express4 project called "actionLog". Since it is a directory tha

Create API for upload file to zoho catalyst using node js

I am creating API for upload file to Zoho Catalyst using Zoho Catalyst dependancy but i got an error that request body is wrong format. expressApp.post('/upload

include of header and footer in ejs file not working

guys I'm working on a node/express app in cloud 9. https://webdevcamp-miatech.c9users.io/ however, the include files in my home.ejs file are not working. I have

Sharp JS Dependency breaks Express Server on Elastic Beanstalk

I feel like this is useless as my conundrum has been discussed in several different threads, but nothing has worked. I have an ExpressJS/node server deployed to