{"id":23377965,"url":"https://github.com/beyondjs/api-server","last_synced_at":"2026-01-27T21:53:41.033Z","repository":{"id":245308225,"uuid":"817843588","full_name":"beyondjs/api-server","owner":"beyondjs","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-14T15:57:27.000Z","size":42,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-26T16:28:02.081Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beyondjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2024-06-20T14:54:47.000Z","updated_at":"2025-04-08T18:57:14.000Z","dependencies_parsed_at":"2024-06-21T09:36:01.572Z","dependency_job_id":"dc239fb9-189e-419c-b53a-d809f1e8b007","html_url":"https://github.com/beyondjs/api-server","commit_stats":null,"previous_names":["beyondjs/api-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/beyondjs/api-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Fapi-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Fapi-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Fapi-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Fapi-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beyondjs","download_url":"https://codeload.github.com/beyondjs/api-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Fapi-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28823772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T18:44:20.126Z","status":"ssl_error","status_checked_at":"2026-01-27T18:44:09.161Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2024-12-21T18:33:37.352Z","updated_at":"2026-01-27T21:53:41.019Z","avatar_url":"https://github.com/beyondjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @beyond-js/api-server\n\nThis package provides a dynamic HTTP API server implementation using Express.js. It is a server prepared to seamlessly\nwork with the BeyondJS framework, including support for hot module replacement (HMR) and OpenAPI specification\nvalidation, allowing for efficient development and deployment of API services.\n\n## Features\n\n-   **Express.js Integration**: Leverages the Express framework for building web applications.\n-   **OpenAPI Validation**: Integrates `express-openapi-validator` for API request and response validation based on\n    OpenAPI specs.\n-   **Hot Module Replacement (HMR)**: Supports HMR to handle changes in routes dynamically without restarting the\n    server.\n-   **Connection Management**: Manages active connections efficiently to ensure graceful server restarts and shutdowns.\n\n## Installation\n\n```bash\nnpm install @beyond-js/api-server\n```\n\n## Usage\n\n### Basic Setup\n\n```typescript\nimport { Server } from '@beyond-js/api-server';\n\nconst server = new Server();\nserver.start('@beyond-js/your-module');\n```\n\n### Module Structure\n\nYour module should export the following structure:\n\n```typescript\nexport const Routes: IRoutes = {\n\tsetup: (app: Express) =\u003e {\n\t\t// Define your routes here\n\t\tapp.get('/example', (req: Request, res: Response) =\u003e {\n\t\t\tres.send('Hello World!');\n\t\t});\n\t},\n};\n\nexport const specs = './path-to-your-openapi-spec.yaml';\n```\n\n### Environment Variables\n\nEnsure you have a `.env` file in your project root with the following configuration:\n\n```\nPORT=8080\n```\n\n### Custom Error Handling\n\nYou can customize error handling by overwriting the `_setErrorHandler` method.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on GitHub.\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Acknowledgments\n\n-   [Express](https://expressjs.com/)\n-   [express-openapi-validator](https://github.com/cdimascio/express-openapi-validator)\n-   [dotenv](https://github.com/motdotla/dotenv)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyondjs%2Fapi-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeyondjs%2Fapi-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyondjs%2Fapi-server/lists"}