ShankyTiwari / Real-time-private-chatting-app-using-Angular-Nodejs-mongodb-and-Socket.io

:fire: Real time private chatting app but using Angular (Lastest), Nodejs, MongoDB and Socket.io.
http://www.codershood.info/2017/02/09/real-time-private-chatting-app-using-angular-2-nodejs-mongodb-socket-io-part-1/
31 stars 15 forks source link

412 (Precondition Failed) #2

Closed divyangdodiya closed 5 years ago

divyangdodiya commented 5 years ago

Getting this error POST http://localhost:4000/usernameAvailable 412 (Precondition Failed) In registration page , where it check for username availability

ShankyTiwari commented 5 years ago

@devdodiya It's not an error, it's a response that you are getting from Node API. Check the request of API http://localhost:4000/usernameAvailable and make sure you are passing required parameters.

Thanks

divyangdodiya commented 5 years ago

I simply cloned your project and make it run , i didn't changed a single file

divyangdodiya commented 5 years ago

all i did is npm install and ng serve and node server.js command nothing else, do i've to take care of any other requirements while running on localhost ??

ShankyTiwari commented 5 years ago

Okay can you share the request and response for http://localhost:4000/usernameAvailable API?

ghoshsuman845 commented 4 years ago

Screenshot (59) Screenshot (60)

ghoshsuman845 commented 4 years ago

I'm also getting the same error while clicking the registration page , please help @ShankyTiwari

ShankyTiwari commented 4 years ago

Hi @ghoshsuman845 have you started your MongoDB server?

ghoshsuman845 commented 4 years ago

Hi @ghoshsuman845 have you started your MongoDB server?

How can we connect to MongoDb Server? I have Mongo Compass in my system when I'm connecting it , its showing some error.

ShankyTiwari commented 4 years ago

What error you are getting?

Assuming that you are using Windows and You have installed MongoDB properly. You can start your MongoDB server by going under this C:\Program Files\MongoDB\Server\3.4\bin directory. Here 3.4 is the MongoDB version it can be different.

Once you will open bin folder you will see the mongod file(mongod.exe), just run it. Now your MongoDB server is running.

Just in case if the above steps are not clear you can read this SO answer, it should help.

What you should after this:

  1. Create a new database, say local.
  2. Check the .env file under NodeJs API and Give proper database URL. Ideally local should be the name of the database since I had created database with a local name.
  3. Now run the code by npm start

Things should work, let me know if anything else not working!

ghoshsuman845 commented 4 years ago

Thankyou! Everything works absolutely fine now. @ShankyTiwari