01-hello.agi 487 B

1234567891011121314
  1. /*---
  2. title: Hello, AGI
  3. group: Basics
  4. summary: Send text back to the browser and log to the console.
  5. ---*/
  6. /*
  7. The smallest WebApp backend script. Whatever the script sends with
  8. sendResp() is the body of the HTTP response the front end receives.
  9. */
  10. console.log("Running as " + USERNAME + " (" + (userIsAdmin() ? "admin" : "user") + ")");
  11. console.log("Script file: " + __FILE__);
  12. var now = new Date();
  13. sendResp("Hello, " + USERNAME + "! The server time is " + now.toISOString());