{"id":15168669,"url":"https://github.com/the-puppet-studios/apicat","last_synced_at":"2026-01-22T16:42:37.262Z","repository":{"id":257395341,"uuid":"858140796","full_name":"The-Puppet-Studios/apicat","owner":"The-Puppet-Studios","description":"An API library written in typescript to simplify API routing. Deno complient.","archived":false,"fork":false,"pushed_at":"2024-09-16T11:37:45.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-15T09:35:29.487Z","etag":null,"topics":["api","apicat","deno","denojs","husky","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/The-Puppet-Studios.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":"2024-09-16T11:36:00.000Z","updated_at":"2024-09-16T11:37:48.000Z","dependencies_parsed_at":"2024-09-16T13:22:55.657Z","dependency_job_id":null,"html_url":"https://github.com/The-Puppet-Studios/apicat","commit_stats":null,"previous_names":["the-puppet-studios/apicat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Puppet-Studios%2Fapicat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Puppet-Studios%2Fapicat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Puppet-Studios%2Fapicat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-Puppet-Studios%2Fapicat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/The-Puppet-Studios","download_url":"https://codeload.github.com/The-Puppet-Studios/apicat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248060775,"owners_count":21041229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api","apicat","deno","denojs","husky","ts","typescript"],"created_at":"2024-09-27T06:40:18.713Z","updated_at":"2026-01-22T16:42:37.200Z","avatar_url":"https://github.com/The-Puppet-Studios.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ApiCat Web Framework Documentation\n\nApiCat is a lightweight api web framework built on top of Deno. It provides a simple and intuitive API for creating web applications with features like routing, middleware support, error handling, and more.\n\n## Table of Contents\n\n1. [Installation](#installation)\n2. [Basic Usage](#basic-usage)\n3. [API Reference](#api-reference)\n   - [Constructor](#constructor)\n   - [Routing Methods](#routing-methods)\n   - [Middleware](#middleware)\n   - [Error Handling](#error-handling)\n   - [Request Validation](#request-validation)\n   - [Query Parameters](#query-parameters)\n   - [Response Headers](#response-headers)\n   - [CORS](#cors)\n   - [Static File Serving](#static-file-serving)\n   - [Starting the Server](#starting-the-server)\n\n## Installation\n\nTo use ApiCat in your Deno project, you need to import it from your project file:\n\n```typescript\nimport { ApiCat } from \"./path/to/ApiCat.ts\";\n```\n\nMake sure you have Deno installed and the Oak dependency is available.\n\n## Basic Usage\n\nHere's a simple example of how to use ApiCat:\n\n```typescript\nimport { ApiCat } from \"./ApiCat.ts\";\n\nconst app = new ApiCat();\n\napp.get(\"/\", (ctx) =\u003e {\n  ctx.response.body = \"Hello, ApiCat!\";\n});\n\napp.listen(8000);\n```\n\n## API Reference\n\n### Constructor\n\n```typescript\nnew ApiCat()\n```\n\nCreates a new instance of the ApiCat application.\n\n### Routing Methods\n\nApiCat provides methods for different HTTP verbs:\n\n- `get(path: string, ...handlers: RouteHandler[])`\n- `post(path: string, ...handlers: RouteHandler[])`\n- `put(path: string, ...handlers: RouteHandler[])`\n- `delete(path: string, ...handlers: RouteHandler[])`\n- `patch(path: string, ...handlers: RouteHandler[])`\n- `all(path: string, ...handlers: RouteHandler[])`\n\nEach method takes a path and one or more handler functions.\n\n### Middleware\n\n```typescript\nuse(middleware: MiddlewareFn)\n```\n\nAdds middleware to the application.\n\n### Error Handling\n\n```typescript\nhandleError(handler: (ctx: Context\u003cState\u003e, error: Error) =\u003e void)\n```\n\nSets up a global error handler for the application.\n\n### Request Validation\n\n```typescript\nvalidate(schema: Record\u003cstring, (value: string | null) =\u003e boolean\u003e)\n```\n\nCreates a middleware for validating request parameters based on the provided schema.\n\n### Query Parameters\n\n```typescript\ngetQueryParams(ctx: Context\u003cState\u003e): Record\u003cstring, string | null\u003e\n```\n\nRetrieves all query parameters from the request.\n\n### Response Headers\n\n```typescript\nsetResponseHeaders(headers: Record\u003cstring, string\u003e)\n```\n\nSets global response headers for all routes.\n\n### CORS\n\n```typescript\ncors(options: CorsOptions = {})\n```\n\nCreates a middleware for handling Cross-Origin Resource Sharing (CORS).\n\n### Static File Serving\n\n```typescript\nstatic(root: string)\n```\n\nCreates a middleware for serving static files from a specified directory.\n\n### Starting the Server\n\n```typescript\nlisten(port: number)\n```\n\nStarts the server on the specified port.\n\n## License\n\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-puppet-studios%2Fapicat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe-puppet-studios%2Fapicat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-puppet-studios%2Fapicat/lists"}