Skip to content

Commit d25bb6e

Browse files
committed
quickly set up a node server to be able to prmore reliably test cookies
1 parent 6818b83 commit d25bb6e

4 files changed

Lines changed: 28 additions & 5 deletions

File tree

‎server.js‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var http = require('http'),
2+
url = require('url'),
3+
path = require('path'),
4+
fs = require('fs');
5+
6+
http.createServer(function (request, response) {
7+
var uri = url.parse(request.url).pathname,
8+
filename = path.join(process.cwd(), uri);
9+
10+
fs.readFile(filename, 'binary', function (err, file) {
11+
if (err) {
12+
response.writeHead(500, { 'Content-Type': 'text/plain' });
13+
response.write(err + '\n');
14+
response.end();
15+
return;
16+
}
17+
18+
response.writeHead(200);
19+
response.write(file, 'utf-8');
20+
response.end();
21+
});
22+
}).listen(8124, '127.0.0.1');
23+
24+
console.log('Server running at http://127.0.0.1:8124/');

test/test.html renamed to test.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<link rel="stylesheet" href="qunit/qunit/qunit.css">
6-
<script src="qunit/qunit/qunit.js"></script>
7-
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
8-
<script src="../jquery.cookie.js"></script>
5+
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css">
6+
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
7+
<script src="http://code.jquery.com/qunit/git/qunit.js"></script>
8+
<script src="jquery.cookie.js"></script>
99
<script src="test.js"></script>
1010
<title>jquery.cookie Test Suite</title>
1111
</head>
File renamed without changes.

‎test/.gitignore‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)