#!/usr/bin/env node if (process.argv[2] === "-h" || process.argv[2] === "--help") { console.log("Usage: webframe [directory]"); console.log(" Create a web server in directory [dir] (or in the current directory).") console.log(" Set the port (default 8080) with the PORT environment variable."); console.log(" Set the host (default 127.0.0.1) with the HOSTNAME environment variable."); process.exit(1); } var webframe = require("."); var dir = process.argv[2] || "."; var app = new webframe.App(); app.get("^.*", webframe.static(dir));