-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Using the browser-bundle.js generated by lispy -b and the following directory structure:
├── browser-bundle.js
├── index.html
├── serve.js
├── serve.ls
└── square.ls
Where index.html and square.ls are the same as http://lispyscript.com/docs/#browserrunning, and serve.js looks like:
#!/usr/bin/env js
// Generated by LispyScript v1.0.0
var http = require('http');
var url = require('url');
var fs = require('fs');
var path = require('path');
var port = (process.argv[2] || 1337);
var baseDir = __dirname;
(http.createServer(function(request,response) {
return (function() {
try {
var reqUrl = url.parse(request.url);
var fsPath = [baseDir,path.normalize(reqUrl.pathname)].join('');
response.writeHead(200,{"Content-Type": "text/html"});
var fStream = fs.createReadStream(fsPath);
fStream.pipe(response);
return fStream.on('error',function(err) {
response.writeHead(404);
return response.end();
});
} catch (e) {
return (function(err) {
response.writeHead(500);
response.end();
return console.log(e.stack);
})(e);
}
})();
})).listen(port);
console.log("listening on port",port);Running ./serve.js will print listening on port 1337, but the loaded page http://localhost:1337/index.html will log an error:
Uncaught TypeError: $.map is not a function
(anonymous function) @ browser-bundle.js:4040
(anonymous function) @ browser-bundle.js:40
Any pointers? Am I missing something?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels