mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
430 B
20 lines
430 B
16 years ago
|
var s = new node.http.Server(function (req, res) {
|
||
16 years ago
|
var body = "exports.A = function() { return 'A';}";
|
||
|
res.sendHeader(200, [
|
||
|
["Content-Length", body.length],
|
||
|
["Content-Type", "text/plain"]
|
||
|
]);
|
||
|
res.sendBody(body);
|
||
|
res.finish();
|
||
16 years ago
|
});
|
||
|
s.listen(8000);
|
||
16 years ago
|
|
||
|
include("mjsunit.js");
|
||
|
var a = require("http://localhost:8000/")
|
||
|
|
||
|
function onLoad() {
|
||
|
assertInstanceof(a.A, Function);
|
||
|
assertEquals("A", a.A());
|
||
16 years ago
|
s.close();
|
||
16 years ago
|
}
|