{"id":34622694,"url":"https://github.com/predetermined/hag","last_synced_at":"2026-05-27T17:31:20.779Z","repository":{"id":113987149,"uuid":"258317666","full_name":"predetermined/hag","owner":"predetermined","description":"Something","archived":false,"fork":false,"pushed_at":"2020-04-23T20:15:27.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T04:49:36.833Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/predetermined.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-23T20:04:56.000Z","updated_at":"2020-04-23T20:15:30.000Z","dependencies_parsed_at":"2023-03-13T13:09:52.487Z","dependency_job_id":null,"html_url":"https://github.com/predetermined/hag","commit_stats":null,"previous_names":["predetermined/hag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/predetermined/hag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predetermined%2Fhag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predetermined%2Fhag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predetermined%2Fhag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predetermined%2Fhag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/predetermined","download_url":"https://codeload.github.com/predetermined/hag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predetermined%2Fhag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33577631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T15:37:47.784Z","updated_at":"2026-05-27T17:31:20.774Z","avatar_url":"https://github.com/predetermined.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hag\n**Don't use this project. There are uncountable bugs and I'm building this project only while I create other projects.**\n\n## Example server start\n```typescript\nimport { Hag } from \"hag\";\nimport Hello from \"./pages/Hello.ts\";\n\nconst app = new Hag();\napp.register(\"/\", Hello);\n\napp.listen(3000);\n```\n\n## Pages\n### Example page\n```typescript\nexport default class Hello {\n    private world: string = \"World\";\n\n    get template() {\n        return `Hello, {{ this.world }}`;\n    }\n}\n\n// Rendered output would be `Hello, World`\n```\n\n### Page exposures\nPage exposures are executed client-side.\nI don't really like how I'm handling it right now. \nIt's getting changed sometime.\n```typescript\nexport default class Hello {\n    get exposures() {\n        return {\n            logClick() {\n                console.log(\"clicked\");\n            }       \n        }\n    }   \n\n    get template() {\n        return `\u003cbutton @onclick=\"logClick\"\u003eLog click\u003c/button\u003e`;\n    }\n}\n```\n\n### Page endpoints\nThe template is getting rerendered \u0026 sent to the automatically.\nEndpoint URLs are build like: `[page]/api/[endpoint]`\n```typescript\nexport default class Hello {\n    private world: string = \"World\";\n\n    get endpoints() {\n        return {\n            GET: {\n                changeWorldText() {\n                    this.world = \"stay home.\";\n                }   \n            }\n        }\n    }   \n\n    get exposures() {\n        return {\n            changoMango() {\n                fetch(\"api/changeWorldText\");\n            }       \n        }\n    }   \n\n    get template() {\n        return `\u003cbutton @onclick=\"changoMango\"\u003eChange the world\u003c/button\u003e Hello, {{ this.world }}`;\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpredetermined%2Fhag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpredetermined%2Fhag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpredetermined%2Fhag/lists"}