

Var comSentence= $("#comSentence").val() I want to be able too see images and I dont want to have this error when I click the postsīlogRoutes.js: const express = require('express'), SchemaTypeOptions: ,Įrror message is longer actually I dont see any reason why its not working I uploaded all my codes in Github you can see all from: MongooseServerSelectionError: ,ĭivergentArrayError: , Also when I click the posts I keep having same error: * MissingSchemaError: , These methods will update the state properties.Hello im trying to make an blog site but when I sign in and click to my name and share something I suppose to see it from home page but I cant see any images. Mern/server/server.js const express = require("express") It should list the packages along with their versions.Īfter we have ensured that dependencies were installed successfully, we create a file called server.js with the following code.: We can check out installed dependencies using the package.json file. This lets you separate configuration files from the code. dotenv installs the module that loads environment variables from a.cors installs a Node.js package that allows cross origin resource sharing.express installs the web framework for Node.js.mongodb command installs MongoDB database driver that allows your Node.js applications to connect to the database and work with data.The command above uses a couple of keywords: Then, we will initialize package.json using npm init. We will jump into the server folder that we created previously and create the server. Then, we create a folder for the back end and name it server. Then we will create a React app- client-in it. This folder will hold all our files after we create a new project. Let’s start by creating an empty directory: mern. We will call the front end client and the back end server.

The front end will be implemented with React and the back end will be implemented with MongoDB, Node, and Express. For this project, we will create both a back end and a front end. So, to leverage its full potential, we will be creating a MERN stack project. MERN lets us create full-stack solutions. (Feel free to code along or to download the full code from this GitHub repo.)
