I am in the process of deploying my MERN app to a Digital Ocean droplet(Ubuntu 20.04 server).
I have cloned my GitHub repo, installed the dependencies and pm2.
I start the server using the command pm2 start server/index.js.
Then when I visit the…
I am seeing similar posts, however none are helping me solve my problem.
Following a Udemy tutorial that builds a MERN application from scratch, I got stuck on the mongoose connection.
Here is my index.js code:
const express =…
I'm trying to make a project using the MERN stack and I encountered this error. I already added the proxy do the JSON file but still no luck.
the error:
GET http://localhost:5000/posts net::ERR_CONNECTION_REFUSED
my actions:
export const getPosts =…
I have deployed my mern stack app on heroku. The problem is i am not able to make any request to my backend .
I am connecting my frontend to my backend like this...
API=http://localhost:5000/api
import { API } from "../../backend";
import {…
Issues occuring:
While system try to invoke child function from parent function, it skip(do not invoke) function and also do not gives any response or error
If child function invoked by parent successfully then it wan't get/fetch the data with help…
I had tried to deploy a MERN stack application on heroku. I had followed the procedure given in the heroku documentation. But, somehow I am unable to deploy the application to heroku.
The following is my server.js code:
const express =…
I am using MERN stack to develop an application. The front end (React + Redux) is totally isolated from backend(express + mongo). I am using CORS, JWT and all good things to connect both of them. The front-end itself has an user view and dashboard…
Based on the scaffolder mern.io I was going through the code to see what was going on. I stumbled upon a .need method which looks like something related to es6 classes. I can't seem to find any usable info anywhere, so I ask what is the .need…
My problem is with Stripe's metadata object having a 500 character limit. I have a working checkout flow but my only restriction is the character limit for my cart. My cartItems object has extras and customer notes I want to include for each cart…
What might be causing the error ```
/usr/local/lib/node_modules/serve/build/main.js:4
import { cwd as getPwd, exit, env as env2, stdout } from "node:process";
^
/usr/local/lib/node_modules/serve/build/main.js:4
import { cwd as getPwd, exit, env as…
I am trying to load data to my App.js file in react from the backend.
I have used redux to build the whole data fetching and storing pipeline from backend to frontend.
Here is the code :
function App() {
const dispatch = useDispatch();
…
I'm trying to implement social login functionality in a MERN SPA so that users can login to my site using their Google/Facebook/Twitter/etc. login. This is clearly a very common scenario, and there are tons of posts and examples that address how to…
I am trying to get image but i am getting error:
Failed to load resource: the server responded with a status of 404 (Not Found)
TopBar.jsx
import { useContext } from "react";
import { Link } from "react-router-dom";
import { Context } from…
I'm working on a MERN-stack project using separated repositories (backend & frontend), In development environment, I was using "proxy" to connect the server API with react, and it was working perfectly.
//package.json in react
{
...
"proxy":…
I'm trying to set up some security middleware for my humble little MERN web app, and I'm currently using helmet and express-mongo-sanitize, specifically for protection against NoSQL injection attacks.
I've set it up, however, as below in my…