Skip to content
This repository was archived by the owner on Jan 18, 2021. It is now read-only.

Commit a07ccfc

Browse files
committed
index webpage
1 parent dbf27b1 commit a07ccfc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

core/intclient.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ InternalClient.prototype.op_verify_operator_key = function InternalClient_op_ver
8888

8989
// public method provide_web
9090
InternalClient.prototype.provide_web = function InternalClient_provide_web(websvr, mgr_base) {
91-
websvr.provide_op(/^\/$/, this.web_mgr_redirect.bind(this, mgr_base));
91+
websvr.provide_op('/mgr', this.web_mgr_redirect.bind(this, mgr_base));
9292
};
9393

9494
// private static property web_mgr_base

web/websvr.js

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var WebServer = function WebServer(port) {
99
this.server = http.createServer(this.request.bind(this)).listen(port);
1010
console.log('WebServer('+port+')');
1111
this.routes = [];
12+
this.provide_op('/', this.op_index.bind(this));
1213
this.provide_op('/robots.txt', this.op_robots.bind(this));
1314
};
1415

@@ -49,6 +50,11 @@ WebServer.prototype.provide_op = function WebServer_provide_op(pattern, handler)
4950
this.routes.push({ pattern:pattern, handler:handler });
5051
};
5152

53+
// private method op_index
54+
WebServer.prototype.op_index = function WebServer_op_index(req, resp) {
55+
resp.end('<!doctype html><title>NDNSF</title><h1>NDNSF - NDN Slim Forwarder</h1><p><a href="http://yoursunny.com/p/NDNSF/">NDNSF homepage</a><p><a href="/mgr">NDNSF Manager</a>');
56+
};
57+
5258
// private method op_robots
5359
WebServer.prototype.op_robots = function WebServer_op_robots(req, resp) {
5460
resp.end('User-Agent: *\nDisallow: /');

0 commit comments

Comments
 (0)