I try to include this build, in my browser JS with Node.js, here is my server code:
var fs = require("fs");
var http = require("http");
var url = require("url");
http.createServer(function (request, response) {
var pathname = url.parse(request.url).pathname;
console.log("Request for " + pathname + " received.");
response.writeHead(200);
if(pathname == "/") {
html = fs.readFileSync("views/index.html", "utf8");
response.write(html);
} else if (pathname == "/ethereumjs-all.js") {
script = fs.readFileSync("views/ethereumjs-all.js", "utf8");
response.write(script);
}
response.end();
}).listen(8000);
console.log("Listening to server on 8000...");
and here is the content of index.html:
<html>
<head>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="/ethereumjs-all.js"></script>
<script>
$(document).ready(function() {
var tx = new Transaction()
...
}); // document.ready
</script>
</head>
<body></body>
</html>
However, in the browser console, I get the error ReferenceError: Transaction is not defined The library should have Transaction class defined. So am I using browserify wrong?
Thanks for any help!
Transactionconstructor?