Node Beginner Book - requestHandlers

As the title says, I have a problem with what node.js command prompt says lies in the requestHandlers.js file. I am following the guide in the Node Beginner Book and until now, there have not been any problems with the book - or rather my code.

I have the following input:

index.js:

`

var server = require("./server");
var router = require("./router");
var requestHandlers = require("./requestHandlers");
var handle = {}
handle["/"] = requestHandlers.start;
handle["/start"] = requestHandlers.start;
handle["/upload"] = requestHandlers.upload;
server.start(router.route, handle);

`

server.js:

`

var http = require("http");
var url = require("url");
function start(route, handle) {
function onRequest(request, response) {
var pathname = url.parse(request.url).pathname;
console.log("Request for " + pathname + " received.");
route(handle, pathname);
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}
http.createServer(onRequest).listen(8888);
console.log("Server has started.");
}
exports.start = start;

`

router.js

`

function route(handle, pathname) {
console.log("About to route a request for " + pathname);
if (typeof handle[pathname] === 'function') {
handle[pathname]();
} else {
console.log("No request handler found for " + pathname);
}
}
exports.route = route;

`

requestHandlers.js

`

function start() {
console.log("Request handler "start" was called.");
}
function upload() {
console.log("Request handler "upload" was called.");
}
exports.start = start;
exports.upload = upload;

`

And I have this output:

"C:\Program Files (x86)\nodejs\requestHandlers.js:1 console.log("Request handler "start" was

SyntaxError: Unexpected identifier
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\Program Files (x86)\nodejs\index.js:1:153)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)"

I can't really see where the problem lies. I have followed the guide in the book and I have either copy-pasted the code from the book or written it myself. I have doublechecked the code for errors, but have not found any. I have remembered to use \'function\' for instance, so there would not be any mistakes in the code when entering it in node.js.

So any help would be appreciated!

Thanks.

You're mixing the different string markers in JavaScript.

function start() {
   console.log("Request handler "start" was called.");
}
function upload() {
  console.log("Request handler "upload" was called.");
}

You can use " for the start and end of a string, but something like "Request handler "start" was called."

Is invalid, because you terminate the string at "start and start a new string at "was called.

If start and upload are variables just concatenate the strings with something like this:

"Request handler " + start + " was called."

or change your string to something like this:

"Request handler 'start' was called."

or remove the " around start and upload.