getdocs.agi 487 B

12345678910111213141516
  1. /*
  2. Terminal — Serve API Documentation
  3. Reads Terminal/docs/api.json from the web root and returns it as JSON.
  4. This keeps the docs file editable without touching Go code.
  5. */
  6. requirelib("appdata");
  7. var content = appdata.readFile("Terminal/docs/api.json");
  8. if (content === false || content === null || content === undefined) {
  9. sendJSONResp(JSON.stringify({error: "Documentation file not found"}));
  10. } else {
  11. HTTP_HEADER = "application/json";
  12. sendResp(content);
  13. }