I am getting into retrieving data from my server by using express. I have a button that needs to display names after click, but it does not seem to be working. I keep getting an error that says 'require' is not defined and when I click the search button I get an error message: 

***jquery.js:9631 GET <http://localhost:10000/> send @ jquery.js:9631ajax @ jquery.js:9176displayTurtles @ serverFS.js:35dispatch @ jquery.js:4641elemData.handle @ jquery.js:4309
index.html:1 XMLHttpRequest cannot load <http://localhost:10000/>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 404.***

I need to show the turtles in a list on the HTML and later also allow user to add new turtle objects using the POST method.

server.js file

```
var express = require('express');
var server = express();

server.get('/', function (req, res) {
      var turtles = {
      message: "success",
      data: [
        {
          name: "Raphael",
          favFood: "Pizza"
        },
        {
          name: "Leonardo",
          favFood: "Pizza"
        },
        {
          name: "Donatello",
          favFood: "Pizza"
        },
        {
          name: "Michelangelo",
          favFood: "Pizza"
        }
      ]
    };
      res.send(turtles)
})

server.listen(10000, function () {
  console.log('Example app listening on port 3000!')
})

```

serverFS.js file

```
$(document).ready(function(){

    var turtleList = $('<ol class="theList">')
    $('.DTurtles').append(turtleList);

    $(document).on('click', '#show', displayTurtles);
});

function displayTurtles(){  

    var emptyArray = [];

    var myQueryUrl = "http://localhost:10000/" + turtleSearch;

    $.ajax({url: myQueryUrl, method: 'GET'}).done(function(response){

        var loopLength = response.data.length;
        var name;
        var food;
        for(var x = 0; x < loopLength; x++) {

            var emptyTurt = {};
            name = response.data[x].name;
            food =  response.data[x].favFood;

            emptyTurt.name = name;
            emptyTurt.food = food;

            emptyArray.push(emptyTurt);
        } 
        console.log(emptyArray)

    });
    console.log(emptyArray)

}

```

HTML file

```
<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <div class="form">
        <form>
            <label for="search-input">Type Something</label><br>
            <input type="text" id="search-input"><br><br>
            <input id="show" type="button" value="For Emergencies Only">
        </form>
    </div>
    <div class="DTurtles">
    </div>

<script src="https://code.jquery.com/jquery.js"></script>

<script type="text/javascript" src="serverFS.js"></script>
</body>
</html>

```

EDIT: Do i need to be specific with my get function on the server.js file? I read on the express website and it said for route parameters do:

```
Route path: /users/:userId/books/:bookId
Request URL: http://localhost:3000/users/34/books/8989
req.params: { "userId": "34", "bookId": "8989" }

```