Fix http_simple server for new API
This commit is contained in:
parent
51c1526b6a
commit
54c8ea5ea2
@ -1,14 +1,18 @@
|
|||||||
libDir = process.path.join(process.path.dirname(__filename), "../lib");
|
path = require("path");
|
||||||
|
|
||||||
|
libDir = path.join(path.dirname(__filename), "../lib");
|
||||||
require.paths.unshift(libDir);
|
require.paths.unshift(libDir);
|
||||||
|
|
||||||
process.mixin(require("sys"));
|
process.mixin(require("sys"));
|
||||||
http = require("sys");
|
http = require("http");
|
||||||
|
|
||||||
fixed = ""
|
fixed = ""
|
||||||
for (var i = 0; i < 20*1024; i++) {
|
for (var i = 0; i < 20*1024; i++) {
|
||||||
fixed += "C";
|
fixed += "C";
|
||||||
}
|
}
|
||||||
|
|
||||||
stored = {};
|
stored = {};
|
||||||
|
|
||||||
http.createServer(function (req, res) {
|
http.createServer(function (req, res) {
|
||||||
var commands = req.uri.path.split("/");
|
var commands = req.uri.path.split("/");
|
||||||
var command = commands[1];
|
var command = commands[1];
|
||||||
@ -16,8 +20,6 @@ http.createServer(function (req, res) {
|
|||||||
var arg = commands[2];
|
var arg = commands[2];
|
||||||
var status = 200;
|
var status = 200;
|
||||||
|
|
||||||
p(req.uri.params);
|
|
||||||
|
|
||||||
if (command == "bytes") {
|
if (command == "bytes") {
|
||||||
var n = parseInt(arg, 10)
|
var n = parseInt(arg, 10)
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user