W
W
websjunior2017-02-12 11:54:01
Node.js
websjunior, 2017-02-12 11:54:01

Why won't mongoose db connect on node js?

At the root of the project there is a file db.js (it has a connection to the database on the Mlab)
At the root of the project there is a file app.js it connects the file with the database and routers
The routes folder contains routers.
It is necessary to establish a connection to the database and add orders,
On the main page there is a button to order a table for Mate Zalka, it adds info to the database, but I can’t get it, it says an error ( Can't set headers after they are sent. ... )
Login and the connection password is entered correctly. Please establish a connection and complete the addition to the database, otherwise I have been sitting for half a day and racking my brain
. I will be grateful in advance.
The project is on the github link, you can clone it for yourself and test it Run the
npm start server
https://github.com/ArtyshkoAndrey/boutique-life

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2017-02-12
@LiguidCool

Can't set headers after they are sent.
Google what it is. In short, you can’t send headers if something has already gone. Most likely it has nothing to do with the database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question