{"id":28444450,"url":"https://github.com/shiftyx1/pyserve","last_synced_at":"2026-02-16T23:35:19.126Z","repository":{"id":291666749,"uuid":"978368796","full_name":"ShiftyX1/PyServe","owner":"ShiftyX1","description":"lightweight HTTP server written in Python","archived":false,"fork":false,"pushed_at":"2025-08-07T23:31:48.000Z","size":536,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T07:13:42.055Z","etag":null,"topics":["http","python","server"],"latest_commit_sha":null,"homepage":"https://pyserve.org/","language":"Python","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/ShiftyX1.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2025-05-05T22:02:50.000Z","updated_at":"2025-08-14T13:23:39.000Z","dependencies_parsed_at":"2025-07-06T16:27:22.515Z","dependency_job_id":"6b39fc4e-90d8-4f1c-81e2-5cec06c70764","html_url":"https://github.com/ShiftyX1/PyServe","commit_stats":null,"previous_names":["shiftyx1/pyserve"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/ShiftyX1/PyServe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShiftyX1%2FPyServe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShiftyX1%2FPyServe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShiftyX1%2FPyServe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShiftyX1%2FPyServe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShiftyX1","download_url":"https://codeload.github.com/ShiftyX1/PyServe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShiftyX1%2FPyServe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29524333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T21:45:09.491Z","status":"ssl_error","status_checked_at":"2026-02-16T21:44:58.452Z","response_time":115,"last_error":"SSL_read: 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":["http","python","server"],"created_at":"2025-06-06T09:09:17.872Z","updated_at":"2026-02-16T23:35:19.121Z","avatar_url":"https://github.com/ShiftyX1.png","language":"Python","readme":"# PyServe\n\nTHIS REPOSITORY HAVE BEEN ARCHIVED. [CHECK THIS INSTEAD](https://git.pyserve.org/aegis/pyserveX)\n\nPyServe is a modern, async HTTP server written in Python. Originally created for educational purposes, it has evolved into a powerful tool for rapid prototyping and serving web applications with unique features like AI-generated content.\n\n\u003cimg src=\"./images/logo.png\" alt=\"isolated\" width=\"150\"/\u003e\n\n[More on web page](https://pyserve.org/)\n\n## Project Overview\n\nPyServe v0.4.2 introduces a completely refactored architecture with modern async/await syntax and new exciting features like **Vibe-Serving** - AI-powered dynamic content generation.\n\n### Key Features:\n\n- **Async HTTP Server** - Built with Python's asyncio for high performance\n- **Advanced Configuration System V2** - Powerful extensible configuration with full backward compatibility\n- **Regex Routing \u0026 SPA Support** - nginx-style routing patterns with Single Page Application fallback\n- **Static File Serving** - Efficient serving with correct MIME types\n- **Template System** - Dynamic content generation\n- **Vibe-Serving Mode** - AI-generated content using language models (OpenAI, Claude, etc.)\n- **Reverse Proxy** - Forward requests to backend services with advanced routing\n- **SSL/HTTPS Support** - Secure connections with certificate configuration\n- **Modular Extensions** - Plugin-like architecture for security, caching, monitoring\n- **Beautiful Logging** - Colored terminal output with file rotation\n- **Error Handling** - Styled error pages and graceful fallbacks\n\n## Getting Started\n\n### Prerequisites\n\n- Python 3.7 or higher\n- Dependencies: `pip install -r requirements.txt`\n\n### Installation\n\n```bash\ngit clone https://github.com/ShiftyX1/PyServe.git\ncd PyServe\npip install -r requirements.txt\n```\n\n### Running the Server\n\nBasic startup:\n```bash\npython run.py\n```\n\nRunning with specific configuration:\n```bash\npython run.py -H 0.0.0.0 -p 8080\n```\n\n## Configuration\n\nPyServe supports two configuration formats with **full backward compatibility**:\n\n### V1 Configuration (Legacy - still supported)\n\n```yaml\nserver:\n  host: 127.0.0.1\n  port: 8000\n  backlog: 5\n\nhttp:\n  static_dir: ./static\n  templates_dir: ./templates\n\nssl:\n  enabled: false\n\nlogging:\n  level: INFO\n```\n\n### V2 Configuration (Recommended)\n\nThe new V2 configuration system adds powerful extensions while maintaining full V1 compatibility:\n\n```yaml\nversion: 2\n\n# Core modules (same as V1)\nserver:\n  host: 0.0.0.0\n  port: 8080\n\nhttp:\n  static_dir: ./static\n  templates_dir: ./templates\n\n# NEW: Extensions system\nextensions:\n  - type: routing\n    config:\n      regex_locations:\n        # API with version capture\n        \"~^/api/v(?P\u003cversion\u003e\\\\d+)/\":\n          proxy_pass: \"http://backend:3000\"\n          headers:\n            - \"API-Version: {version}\"\n        \n        # Static files with caching\n        \"~*\\\\.(js|css|png|jpg)$\":\n          root: \"./static\"\n          cache_control: \"max-age=31536000\"\n        \n        # SPA fallback\n        \"__default__\":\n          spa_fallback: true\n          root: \"./dist\"\n```\n\n#### Key V2 Features:\n\n- **Regex Routing** - nginx-style patterns with priorities\n- **SPA Support** - Automatic fallback for Single Page Applications  \n- **Parameter Capture** - Extract URL parameters with named groups\n- **External Modules** - Load extensions from separate files\n- **Graceful Degradation** - Errors in extensions don't break core functionality\n\n📖 **[Complete V2 Configuration Guide](./CONFIGURATION_V2_GUIDE.md)** - Detailed documentation with examples\n\n### Quick V2 Examples\n\n#### Simple SPA Application\n```yaml\nversion: 2\nserver:\n  host: 0.0.0.0\n  port: 8080\nhttp:\n  static_dir: ./static\nextensions:\n  - type: routing\n    config:\n      regex_locations:\n        \"~^/api/\": { proxy_pass: \"http://localhost:3000\" }\n        \"__default__\": { spa_fallback: true, root: \"./dist\" }\n```\n\n#### Microservices Gateway\n```yaml\nversion: 2\nextensions:\n  - type: routing\n    config:\n      regex_locations:\n        \"~^/api/users/\": { proxy_pass: \"http://user-service:3001\" }\n        \"~^/api/orders/\": { proxy_pass: \"http://order-service:3002\" }\n        \"=/health\": { return: \"200 OK\" }\n```\n\n### Main Configuration (config.yaml)\n\n```yaml\nserver:\n  host: 127.0.0.1\n  port: 8000\n  backlog: 5\n  redirect_instructions:\n    - /home: /index.html\n\nhttp:\n  static_dir: ./static\n  templates_dir: ./templates\n\nssl:\n  enabled: false\n  cert_file: ./ssl/cert.pem\n  key_file: ./ssl/key.pem\n\nlogging:\n  level: INFO\n  log_file: ./logs/pyserve.log\n  console_output: true\n  use_colors: true\n```\n\n### Vibe Configuration (vibeconfig.yaml)\n\nFor AI-generated content mode:\n\n```yaml\nroutes:\n  \"/\": \"Create a beautiful landing page\"\n  \"/about\": \"Generate an about page\"\n\nsettings:\n  cache_ttl: 3600\n  model: \"gpt-4\"\n  api_url: \"https://api.openai.com/v1\"  # Optional custom endpoint\n```\n\n## Architecture\n\nPyServe v0.4.2 features a modular architecture:\n\n- **Core** - Base server components and configuration\n- **HTTP** - Request/response handling and routing  \n- **Template** - Dynamic content rendering\n- **Vibe** - AI-powered content generation\n- **Utils** - Helper functions and utilities\n\n## Use Cases\n\n- **Modern Web Applications** - SPA hosting with API proxying\n- **Microservices Gateway** - Route requests to multiple backend services\n- **Development** - Quick local development server with hot-reload friendly routing\n- **Prototyping** - Rapid testing with regex-based routing\n- **Education** - Learning HTTP protocol, routing, and server architecture\n- **AI Experimentation** - Testing AI-generated web content with Vibe-Serving\n- **Static Sites** - Advanced static file serving with caching rules\n- **Reverse Proxy** - Development and production proxy setup with pattern matching\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is distributed under the MIT license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiftyx1%2Fpyserve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiftyx1%2Fpyserve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiftyx1%2Fpyserve/lists"}