I'm building a REST API, using Node, Express, MySQL.

When requesting a list of Node from the <http://localhost:3000/Node> endpoint,
I would like to limit these to only 25 initial records.
This could be accomplished with a request like GET <http://localhost:3000/Node?maxRecords=25>.

My routes\Nodes file is:

```
var express = require('express');
var router = express.Router();
var Node=require('../models/Node');

router.get('/:id?',function(req,res,next){

    if(req.params.id){
        Node.getNodeById(req.params.id,function(err,rows){

            if(err)
            {
                res.json(err);
            }
            else{
                res.json(rows);
            }
        });
    }

    else{
        Node.getAllNodes(function(err,rows){

            if(err)
            {
                res.json(err);
            }
            else
            {
                res.json(rows);
            }
        });
    }
});
module.exports=router;

```

And in my models\Node.js (that is passing queries to db) is:

```
var db=require('../dbconnection');

var Node={

    getAllNodes:function(callback){

        return db.query("Select * from node_link",callback);

    },
    getNodeById:function(id,callback){

        return db.query("select * from node_link where id=?",[id],callback);
    }

}
module.exports=Node;

```