How to make multiple calls to nodejs from javascript/jquery/webpage

I have written a nodejs plugin in C++ and I am trying to call it from within a locally hosted webpage with jQuery. I have read that I can't make a direct call to nodejs because of the same origin policy so I should use jsonp. Note: I am pretty new to jquery, nodejs and json(p), but I am feeling adventurous. I am now using the following code:

node_test.js:

var mylib = require("./mylibrary");
var http = require("http");

http.createServer(function(req, res) {
    console.log("Received request: " + JSON.stringify(req.url));
    res.writeHead(200, {"Content-type": "text/plain"});
    res.end('_testcb(\'{"message": "' + mylib.my_awesome_function() + '"}\')');
}).listen(1337);

index.html:

index.html:
<DOCTYPE HTML>
<html>
    <head>
        <title>
            NodeJS test
        </title>
        <link rel='stylesheet' type='text/css' href='style.css'/>
        <script type='text/javascript' src='jquery.js'></script>
    </head>
    <body>
    <div id="test"></div>
    <script>
        $(document).ready(function() {
            $.ajax({
                url: "http://127.0.0.1:1337/",
                dataType: "jsonp",
                jsonpCallback: "_testcb",
                cache: false,
                data: "test_data",
                timeout: 5000,
                success: function(data) {
                    $("#test").append(data);
                },
                error: function(jqXHR, textStatus, errorThrown) {
                    alert('error ' + textStatus + " " + errorThrown);
                }
            });
        });
    </script>
    </body>
</html>

If I run node node_test.js and view index.html in my browser my function gets called. However, I would like to be able to execute multiple functions from my own nodejs library. I thought of somehow parsing the data I send to my nodejs app, and run it through a big switch case, a bit like this:

var reply = "";
switch (data) {
    case 1:
        reply = mylib.my_awesome_function();
        break;
    case 2:
        reply = mylib.my_cool_function();
        break;
    // repeat for every function I have
}
// send reply

But I am not sure if this is the intended way to do this. Is there a better/smarter way to make multiple calls to nodejs from within jQuery/javascript on a webpage?