File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,14 @@ import { open } from 'open';
88class TrainingHandler extends SimpleHTTPRequestHandler {
99 // Override the do_GET method to handle custom requests.
1010 do_GET ( req , res ) {
11- // Custom handling can go here, or just use the parent class behavior.
12- return super . do_GET ( req , res ) ;
11+ // Check if the requested file is 'demo.html'.
12+ if ( req . url === '/demo.html' ) {
13+ // Serve the 'demo.html' file.
14+ this . sendFile ( req , res , 'demo.html' ) ;
15+ } else {
16+ // Use the parent class behavior for other requests.
17+ super . do_GET ( req , res ) ;
18+ }
1319 }
1420}
1521
@@ -23,5 +29,5 @@ server.listen(port);
2329// Print a message to the console indicating that the server is running.
2430console . log ( `Serving VR training at http://localhost:${ port } ` ) ;
2531
26- // Open a new tab in the default browser to access the training page.
32+ // Open a new tab in the default browser to access the 'demo.html' page.
2733open ( `http://localhost:${ port } /demo.html` ) ;
You can’t perform that action at this time.
0 commit comments