mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-24 11:38:30 +00:00
BetterTTV Integration
This commit is contained in:
parent
cc71863800
commit
4e6942e2f3
11 changed files with 576 additions and 100 deletions
|
@ -1,3 +1,5 @@
|
|||
var version = "0.1.0";
|
||||
|
||||
var fs = require("fs"),
|
||||
http = require("http"),
|
||||
path = require("path"),
|
||||
|
@ -8,6 +10,12 @@ http.createServer(function(req, res) {
|
|||
var uri = url.parse(req.url).pathname,
|
||||
lpath = path.join(uri).split(path.sep);
|
||||
|
||||
if ( uri == "/dev_server" ) {
|
||||
console.log("[200] GET " + uri);
|
||||
res.writeHead(200, {"Content-Type": "application/json", "Access-Control-Allow-Origin": "*"});
|
||||
return res.end(JSON.stringify({path: process.cwd(), version: version}));
|
||||
}
|
||||
|
||||
if ( ! lpath[0] )
|
||||
lpath.shift();
|
||||
|
||||
|
@ -26,7 +34,7 @@ http.createServer(function(req, res) {
|
|||
|
||||
if ( fs.lstatSync(file).isDirectory() ) {
|
||||
console.log("[403] GET " + uri);
|
||||
res.writeHead(403);
|
||||
res.writeHead(403, {"Access-Control-Allow-Origin": "*"});
|
||||
res.write('403 Forbidden');
|
||||
return res.end();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue