ReferenceError: dbo is not defined : Bellow attach folder directory ,server.js and api.js file . 
program is not running give me error like
ReferenceError: dbo is not defined
    at C:\shivapp\mean_app\mandiapp\server\api.js:18:1
    at Layer.handle [as handle_request] (C:\shivapp\mean_app\mandiapp\node_modules\express\lib\router\layer.js:95:5)
    at next (C:\shivapp\mean_app\mandiapp\node_modules\express\lib\router\route.js:137:13)
    at Route.dispatch (C:\shivapp\mean_app\mandiapp\node_modules\express\lib\router\route.js:112:3)
    at Layer.handle [as handle_request] (C:\shivapp\mean_app\mandiapp\node_modules\express\lib\router\layer.js:95:5)
    at C:\shivapp\mean_app\mandiapp\node_modules\express\lib\router\index.js:281:22
    at Function.process_params (C:\shivapp\mean_app\mandiapp\node_modules\express\lib\router\index.js:335:12)
    at next (C:\shivapp\mean_app\mandiapp\node_modules\express\lib\router\index.js:275:10)
    at Function.handle (C:\shivapp\mean_app\mandiapp\node_modules\express\lib\router\index.js:174:3)
    at router (C:\shivapp\mean_app\mandiapp\node_modules\express\lib\router\index.js:47:12).

Please help me ..
 


folder directory

[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/EVxtW.png

**File-> server.js**

    var express=require('express');
    var bodyParser=require('body-parser');
    var path=require('path');
    var http = require('http');
    var app=express();
    
    
    var api= require('./server/api');
    
    app.use(bodyParser.json());
    app.use(bodyParser.urlencoded({extended: false}));
    
    app.use(express.static(path.join(__dirname,'dist')));
    
    app.use('/',api);
    //8376884527
    app.get('*'),(req,res) => {
    
    	res.sendFile(path.join(__dirname,'dist/index.html'));
    }   
    
    
    
    
    var port= process.env.port || '3000';
    
    app.set('port',port);
    
    var server = http.createServer(app);
    
    server.listen(port,()=>console.log('server running...'));


**file -> api.js**

     var express = require('express');
     var router = express.Router(); 
     
     
    
    var MongoClient = require('mongodb').MongoClient;
    var ObjectID = require('mongodb').ObjectID;
    
    
    
    MongoClient.connect("mongodb://localhost:27017/mandiapp", function(err, db) {
      if(err) throw err;
        var dbo = db.db("mandiapp");
    });
    
    router.get('/users', function(req, res) {
    
    dbo.collection("user").find({}).toArray(function(err, result) {
        if (err) throw err;
        res.json(result);
        //dbo.close();
      })
    })
    
    router.get('/recent', function(req, res) {
      var collection = db.get().collection('comments')
    
      collection.find().sort({'date': -1}).limit(100).toArray(function(err, docs) {
        res.render('comments', {comments: docs})
      })
    })
    
    
    
    module.exports = router











    