-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.js
25 lines (22 loc) · 885 Bytes
/
demo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require('npm-trospect').require = require; //global require
var Resource = require('./protolus-resource');
require('./handler-js');
var app = require('http').createServer(function handler(req, res){
Resource.handle(req, res, function(){
new Resource('test-component', function(){
Resource.head(true, function(tags){
res.end('<html>'+"\n "+'<head>'+"\n "+(tags.join("\n "))+"\n "+'</head>'+"\n "+'<body><h1>Heya!</h1>'+"\n "+'</body>'+"\n"+'</html>');
});
});
});
});
app.listen(80);
var request = require('request');
/*request('http://localhost/js/test-component', function (error, response, body) {
var check = require('syntax-error');
if (!error && response.statusCode == 200) {
var err = check(body);
if(err) throw('OMG, Error!')
else console.log('No Errors!');
}
});*/