MERN-Stack | MERN stack practice | Frontend Framework library
kandi X-RAY | MERN-Stack Summary
kandi X-RAY | MERN-Stack Summary
MERN stack practice
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MERN-Stack
MERN-Stack Key Features
MERN-Stack Examples and Code Snippets
Community Discussions
Trending Discussions on MERN-Stack
QUESTION
So I did the deployment exactly like here: https://medium.com/@rksmith369/how-to-deploy-mern-stack-app-on-aws-ec2-with-ssl-nginx-the-right-way-e76c1a8cd6c6
But my React App wont load, instead it gets blocked(Content Security Policy).
Maybe something with nginx? Or is my React app broken? I was searching the whole day so I thought I give it a try and ask for help.
Edit: New Problem my homepage gets loaded, but on all of the other sites I get a 404 if I reload...
New Server.js
...ANSWER
Answered 2021-May-23 at 19:29the problem is not with your React App or the your server, but its with your helmet configuration. Update your CORS configuration to provide a valid content security policy. For example
QUESTION
Im trying to make an ecommerce app and the frontend is all done but when i place an order i get this message.
I rechecked every file but i cant find where its coming from. I followed the process from a udemy course but it just doesnt work. i got no response from the instructor and his code seems to work fine. Here is the github master repo for the course. I am stuck here for 10 days. HELP! https://github.com/bluebits-academy/mern-stack-ecommerce
This is my Order.js
...ANSWER
Answered 2021-Apr-22 at 05:20The error :
QUESTION
I'm building a social media app using MERN stack.
I'm using POSTMAN to test the Backend API.
Below is the dependencies list i.e., package.json file.
...ANSWER
Answered 2021-Mar-21 at 08:20const token = jwt.sign({ _id: user.id, }, config.jwtSecret);
in here you should use _id: user._id
QUESTION
Being new to Docker, I am following a tutorial but using my own personal MERN-stack project. My personal project folder structure consists of a frontend folder and a backend folder and my Dockerfile placed in the root directory. My frontend is uses localhost:3000 and my backend at localhost:5000. I am trying to view my application in the browser; however, it takes me to a page that states this site can't be reached
for http://localhost:3000 and http://localhost:5000
and for http://172.17.0.3:3000
its just a blank forever loading page.
If it helps, i'm using a macOS.
steps i've taken:
docker build -t foodcore:1.0 .
docker run -p 3001:3000 -p 5001:5000 foodcore:1.0
outcome in my terminal:
...ANSWER
Answered 2021-Jan-07 at 02:11UPDATE
Turns out by through this outline
docker run -p :
i was initially setting my host port to 3001 instead of 3000. Thus, accessing the wrong port
QUESTION
It is an app developed with the MERN-stack, deployed to Heroku.
On GitHub I had a number of automated pull requests from Dependabot
with security vulnerabilities.
Once I fixed them all, my app (On Edge browser) actually said it was Secure, a few days ago.
But now for some reason it's back to (Not Secure) and maybe it doesn't matter, but I'd like my app that's gonna be used by others to be secure as possible.
...ANSWER
Answered 2020-Nov-27 at 05:15Found the solution at
https://www.support.com/how-to/how-to-fix-this-site-is-not-secure-error-in-edge-12875
Fix: Clear browsing history/cache from Microsoft Edge
Site is now secure
QUESTION
I am working on a Mern-stack and I am using Material-UI on my frontend. My GridList is working fine, but I want to have my description text at the bottom of the image instead of in-front of the image.
When I add the text at the bottom it does not display, the image covers it. how can I add a text below/bottom of the image?
...ANSWER
Answered 2020-Aug-26 at 12:15Ciao, the problem is the img
that has an height set to default at 100%. So it's just necessary to reduce img
height. In your case you could do something like:
QUESTION
I am working on a Mern-stack Application, but I'm not able to clear the input field after a successful post Request. I am using a function-based component with useEffect. I have tried so many things but it still didn't work, I also tried examples I got here on StackOverflow but it still didn't work. after submitting successfully the input still left in the input field. how do I make this to clear?
i have tried setCommentData([])
after the submit but it didn't work.
Here is my Component
...ANSWER
Answered 2020-Aug-18 at 20:15In your onSubmit
function, call setName("")
and setEventComment("")
to clear those values.
Also, just to follow conventions, I would rename setEventComment
to setEventDescription
since the state variable is named eventDescription
not eventComment
.
QUESTION
I am following: https://www.digitalocean.com/community/tutorials/getting-started-with-the-mern-stack.
I would like to test an API endpoint built using express. I would like to test POST.
The node server is running and I am using postman to check if the endpoint is working.
I am unclear on how to format the post data and my POST requests result in errors when I send them.
My API is below:
...ANSWER
Answered 2020-Aug-17 at 04:18Open Postman, select request as POST and click on Body.
Under Body, select raw and insert your data in the space below like this and change from text to JSON option:-
{ "action":"asdf" }
Please make sure to add this to your app.js file before any route handler
const app = express(); app.use(express.json());
QUESTION
I am following the tutorial https://github.com/vasansr/pro-mern-stack-2 (to build a CRUD app 'Issue Tracker'). Since i split the app from a single server to separate api and ui servers, I have been having problems getting the ui to load in the browser. Initially i was getting 'unexpected token < in JSON at position 0' in the dev tools console (after creating separate ui and api servers). Then failing to fix this i continued with the chapter hoping more changes might resolve the issue. Now i have completed everything up to and including Ch7 Proxy-Based-Architecture. The ui will still not load in the browser and i'm getting the above (404) error. Everything else appears to be working fine: both servers are running in the terminal and the graphql playground is loading fine.
The code should be fine as i've even gone over it and even copied and pasted from this Git repository just to be double sure. I've also checked the file structure. The only difference is my package.json, as due to dependancy issues i've encountered, some of the package versions are different, so i'm wondering if this could be the problem. But it is unclear to me as i'm getting no issues in the terminal when i run the servers.
This is my ui package.json:
...ANSWER
Answered 2020-Aug-16 at 14:56The problem here was i hadn't compiled my code. I am using babel and had made some changes not realising i needed to recompile my App.js file. As i was trying different things i also got the error:
GET http://localhost:8000/App.js net::ERR_ABORTED 404 (not found)
So i used the command npm run watch in my ui terminal (App.js file is in my user interface directory).
So it seems the problem was i couldn't load the uncompiled file in my browser.
QUESTION
I am working on Mern-Stack Application, and I am facing a challenge with comparing dates in Reacts and Material-UI.
I have an Event Model that has startingDate and closingDate Attribues.
when displaying the EVents on the List. what I want is, if the date for the event has passed then the event should show something like this. Started: Sunday, August 9, 2020, 3 pm
Ended: Sunday, August 9, 2020, 6 pm
. if the event is upcoming then it should show Starting: Sunday, August 9, 2020, 3 pm
Ends: Sunday, August 9, 2020, 6 pm
. But if the Event is Live (if it has started but has not ended) then the event should show Live: Sunday, August 9, 2020, 3 pm
. `Ends: Sunday, August 9, 2020, 8 pm.
but I don't know why it's not really working as it should, the && operator is not evaluating as it should to make it show Live
This is my Event Schema just for you to understand the data-type I am using for a date.
...ANSWER
Answered 2020-Aug-09 at 15:19Basically using nested ternaries is a bad practice because its gets messy and became not readable, in cases like this one its commonly solved by using a function that does the work, exp:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MERN-Stack
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page