harbor run -t openthoughts/tasktrove-exp-rpt-stack-dockerfile-gpt5mini-v3-stack-dockerfile-gpt4o-4490harbor download openthoughts/tasktrove-exp-rpt-stack-dockerfile-gpt5mini-v3-stack-dockerfile-gpt4o-4490Create a small Node.js-based utility and HTTP server that inspects and serves the static website files already present in /app/. Place all solution files directly in /app/. Do not modify any other system files.
Requirements
Files to create (all placed in /app/):
server.js behavior:
Use only Node core modules (http, fs, path, crypto, url).
Listen on the port defined by the environment variable PORT, or default to 3000.
Serve static files from the directory where the script runs (i.e., /app/) for GET requests to paths corresponding to files (like /index.html, /css/app.css, etc.). Set basic Content-Type header based on file extension (support at least: .html, .css, .js, .json, .png, .jpg, .svg, .ico; default to application/octet-stream).
Handle path traversal securely: do not allow requests to escape /app/ (use path normalization and ensure requested path starts with the base directory).
For missing files return 404 with a simple plain-text message.
API endpoint: GET /health
API endpoint: GET /file?path=
Logging: print brief startup message showing the port; log each incoming request line (method and url) to stdout.
analyze.js behavior:
Correctness and security:
Examples / expected commands:
Start server: PORT=4000 node server.js
Run analyzer: node analyze.js
Notes and hints