Web framework.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cli.js 553B

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