Chris911 / Broccoli

Node Broccoli
4 stars 1 forks source link

API - Request on non-existant domain are creating empty DB #12

Open Diastro opened 12 years ago

Diastro commented 12 years ago

When calling the API endpoint with a domain which isn't in the DB, it will create the DB but will leave it empty.

Ex : http://kepler.step.polymtl.ca:8089/API/visits/fakeDomain.org

Desired behaviour : If a request is made to a non-existant domain, drop the query.

Try to see if

db.open(function(err,db){
        if(err) {
            logger.logRequest('error', "Error checking visitsCount for APIrequest (see Mongo logs, avail. connections?) " + request.hash, request);
            return;
        }

Has a return value when the db doesn't exits.