Category "express"

Access raw body of Stripe webhook in Nest.js

I need to access the raw body of the webhook request from Stripe in my Nest.js application. Following this example, I added the below to the module which has a

NodeJS + Express + Socket.IO : CANNOT GET ERROR

I'm programming chat app using socket.io . Chatting works well but trying to get 'http://myurl/upload', it give me the error"cannot GET//uplad". What is the pro

Cannot create property 'ignore_whitespace' on string ' '

const Validator = require("validator"); const isEmpty = require("../validation/is-empty"); module.exports = function validateRegisterInput(data) { let errors

Not able to get response , showing Operation `users.findOne()` buffering timed out after 10000ms`

I am facing an error while making the POST login request. I had deployed the frontend on Netlify here and the backend on Heroku here. This is my backend logs ht

Express module.js:550 throw err; ^ Cannot find module

I'm trying to initialize a simple express app with the following code: const express = require('express'); const app = express() const bodyParser = require('bo

Heroku application crashed: at=error code=H10 desc=“App crashed” method=GET path=“/”

*I have been trying to upload my MERN app to Heroku and have been getting these error codes. The web application will run on my local host but the application i

AWS S3/IAM CORS/Prefetch error when Uploading Image

I'm having problems setting up an S3 and IAM so that I can upload media files to the bucket. I've been following a video (https://www.youtube.com/watch?v=yGYeYJ

Nodejs Socket hang up & ECONNRESET - HTTP post request from Meteor to Node js server

I am using a node server to handle all my push notifications services like gcm and apn. I have 2 different servers. One is running Meteor and another is runnin

Express js,mongodb: “ReferenceError: db is not defined” when calling a function

The code is set up this way: var express = require('express'); var router = express.Router(); var mongo = require('mongodb').MongoClient; function getData(){

CORS in node blocks POSTMAN to get data?

I'm using POSTMAN dev tool to test this API : http://localhost:3000/users and I have this express.js script : const express = require("express"); const cors

How to handle React Router with Node Express routing

I am trying to manage a react app with react router and node js server my router in react: <BrowserRouter> <Switch> <PrivateRoute tok

MongoDB sets my database to 'test' automatically. How to change it?

mongoose.connect(process.env.DATABASE_URL, {useNewUrlParser: true}); const MyModel = mongoose.model(mymodel, new Schema({ name: String })); This creates a dat

How to tell if a user is logged in with http only cookies and JWT in react (client-side)

So I'm trying to follow the security best practices and I'm sending my JWT token over my React app in a only-secure http-only cookie. This works fine for requ

How to get access to data in Github Repo with Nodejs Express

I'm currently trying to get COVID-19 from the Covid Data Repository by Johns Hopkins. https://github.com/CSSEGISandData/COVID-19 The repo get updated with new d

How to do update in AWS Dynamo DB using NodeJS

I have written this function to do update in dynamo table const updateTask = async (req, res) => { try { const { existingTaskText,updatedTaskText } = r

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