From 4ed37bc46ad6e769e9c47ea3afcc37aa10e678a2 Mon Sep 17 00:00:00 2001 From: Bram van der Veen <96aa48@gmail.com> Date: Mon, 10 Aug 2015 16:46:29 +0200 Subject: [PATCH] Fixed a small bug with the config being called before it was initialized --- lookup.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lookup.js b/lookup.js index e24bd1a..e749f67 100644 --- a/lookup.js +++ b/lookup.js @@ -1,11 +1,13 @@ //lookup.js -var fs = require('fs'); -var database = require('mongoskin').db('mongodb://' + config().database); //Initialize the database connection. -//Getting local variables stored in the configuration file. +//Getting local variables via the configuration file. var config = require('./configuration'); var school_id = config().school_id; +//Getting first and third party modules +var fs = require('fs'); +var database = require('mongoskin').db('mongodb://' + config().database); //Initialize the database connection. + //Function for looking through the database and finding entries related to the searchterm. function get(req, res, next, search) { var index = database.collection('index'); //Initialize the database collection.