Index: work/remote/web/testserver/README =================================================================== --- work/remote/web/testserver/README (revision 5234) +++ work/remote/web/testserver/README (revision 5235) @@ -1,21 +1,9 @@ testserver ========== -Simple node.js webserver for websocket testing. +Simple node.js webserver for web client testing. -The server serves static files in the ../testclient directory. -There is a websocket server listening at `/serverecho`, -which simply echoes received messages. - -There is another websocket server listening at `/clientecho`. -When the client connects to the socket, the server side user may send text -messages to the client from stdin. -Client responses are logged by the server to stdout together with other -events. - - - Preconditions ------------- Install node.js v4.x.x or higher (v6.x.x is recommended). @@ -25,11 +13,35 @@ Starting the server ------------------- -To start the server use the `npm start` command. +To start the server enter the `testserver` directory and use the `npm start` +command, provided node.js can be invoked as `node` on your machine. +Alternatively you can use the following command. + + app.js + The server is listening on port 3000 by default. The port can be overridden by setting the `port` environment variable. +Static files +------------ +Static files are served from the `client`, `protocol` and `testdata` +directories. + + +Websockets +---------- + +There is a websocket server listening at `/serverecho`, +which simply echoes received messages. + +There is another websocket server listening at `/clientecho`. +When the client connects to the socket, the server side user may send text +messages to the client from stdin. +Client responses are logged by the server to stdout together with other +events. + + Manual clean up --------------- Index: work/remote/web/testserver/app.js =================================================================== --- work/remote/web/testserver/app.js (revision 5234) +++ work/remote/web/testserver/app.js (revision 5235) @@ -22,7 +22,10 @@ }); // this will serve static files -app.use(express.static("../testclient")); +app.use("/", express.static("../client")); +app.use("/test", express.static("../testclient")); +app.use("/testdata", express.static("../testdata")); +app.use("/protocol", express.static("../protocol")); // this will log http requests app.use(morgan("common"));