{"id":24807291,"url":"https://github.com/stackpress/ingest","last_synced_at":"2026-03-16T04:04:26.269Z","repository":{"id":257806440,"uuid":"866275302","full_name":"stackpress/ingest","owner":"stackpress","description":"Event Driven Serverless Framework","archived":false,"fork":false,"pushed_at":"2025-09-01T08:42:49.000Z","size":978,"stargazers_count":8,"open_issues_count":0,"forks_count":10,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-28T04:59:00.323Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackpress.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,"zenodo":null}},"created_at":"2024-10-02T00:29:37.000Z","updated_at":"2025-09-01T08:42:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"48723f99-5f4f-4c27-8433-2d4ba7024ba8","html_url":"https://github.com/stackpress/ingest","commit_stats":null,"previous_names":["stackpress/ingest"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/stackpress/ingest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpress%2Fingest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpress%2Fingest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpress%2Fingest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpress%2Fingest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackpress","download_url":"https://codeload.github.com/stackpress/ingest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpress%2Fingest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014521,"owners_count":26085536,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"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-01-30T09:18:02.750Z","updated_at":"2025-10-13T09:30:34.330Z","avatar_url":"https://github.com/stackpress.png","language":"TypeScript","readme":"# ᗊ Ingest\n\n[![NPM Package](https://img.shields.io/npm/v/@stackpress/ingest.svg?style=flat)](https://www.npmjs.com/package/@stackpress/ingest)\n[![Tests Status](https://img.shields.io/github/actions/workflow/status/stackpress/ingest/test.yml)](https://github.com/stackpress/ingest/actions)\n[![Coverage Status](https://coveralls.io/repos/github/stackpress/ingest/badge.svg?branch=main)](https://coveralls.io/github/stackpress/ingest?branch=main)\n[![Commits](https://img.shields.io/github/last-commit/stackpress/ingest)](https://github.com/stackpress/ingest/commits/main/)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat)](https://github.com/stackpress/ingest/blob/main/LICENSE)\n\nAn unopinionated, event driven, pluggable, server/less framework.\n\n## Overview\n\nIngest is a lightweight, flexible server framework that brings the familiar Express.js-like API to serverless environments. Built on top of the powerful `@stackpress/lib` event system, Ingest provides a unified approach to building applications that can run anywhere - from traditional Node.js servers to serverless platforms like AWS Lambda, Vercel, and Netlify.\n\n## Key Features\n\n- **🚀 Serverless-First**: Designed specifically for serverless environments while maintaining compatibility with traditional servers\n- **🔄 Event-Driven**: Built on a robust event system that enables reactive programming patterns\n- **🛣️ Multi-Routing Interface**: Four different routing approaches in one framework\n- **🔌 Plugin System**: Highly extensible with a simple plugin architecture\n- **📦 Build Support**: Exposes routing information for bundlers and build tools\n- **🌐 Cross-Platform**: Works with Node.js HTTP, WHATWG Fetch, and various serverless platforms\n\n## Installation\n\n```bash\nnpm install @stackpress/ingest\n# or\nyarn add @stackpress/ingest\n```\n\n## Quick Start\n\n### Basic HTTP Server\n\n```typescript\nimport { server } from '@stackpress/ingest/http';\n\nconst app = server();\n\n// Traditional Express-like routing\napp.get('/', (req, res) =\u003e {\n  res.setHTML('\u003ch1\u003eHello World!\u003c/h1\u003e');\n});\n\napp.get('/api/users/:id', (req, res) =\u003e {\n  const userId = req.data.get('id');\n  res.setJSON({ id: userId, name: 'John Doe' });\n});\n\n// Start the server\napp.create().listen(3000, () =\u003e {\n  console.log('Server running on port 3000');\n});\n```\n\n### Serverless Function (Vercel)\n\n```typescript\nimport { server } from '@stackpress/ingest/whatwg';\n\nconst app = server();\n\napp.get('/api/hello', (req, res) =\u003e {\n  res.setJSON({ message: 'Hello from Vercel!' });\n});\n\nexport default async function handler(request: Request) {\n  return await app.handle(request, new Response());\n}\n```\n\n## Multi-Routing Interface\n\nIngest provides four different ways to define routes, giving you flexibility in how you organize your application:\n\n### 1. Action Router (Traditional)\nExpress.js-like inline route handlers:\n\n```typescript\napp.action.get('/users', (req, res) =\u003e {\n  res.setJSON({ users: [] });\n});\n```\n\n### 2. Entry Router (File-based)\nRoute to files that export default handlers:\n\n```typescript\napp.entry.get('/users', './routes/users.js');\n```\n\n### 3. Import Router (Lazy Loading)\nDynamic imports for code splitting:\n\n```typescript\napp.import.get('/users', () =\u003e import('./routes/users.js'));\n```\n\n### 4. View Router (Template-based)\nDirect template rendering:\n\n```typescript\napp.view.get('/users', './views/users.hbs');\n```\n\n### Inferred Routing\n\nIngest can automatically determine which router to use based on your input:\n\n```typescript\n// Automatically uses action router\napp.get('/users', (req, res) =\u003e { /* handler */ });\n\n// Automatically uses import router\napp.get('/users', () =\u003e import('./routes/users.js'));\n\n// Automatically uses view router\napp.get('/users', './views/users.hbs');\n```\n\n## Plugin System\n\nIngest features a powerful plugin system that allows you to modularize your application:\n\n### Creating a Plugin\n\n```typescript\n// src/plugins/auth.ts\nexport default function authPlugin(server) {\n  server.on('request', (req, res) =\u003e {\n    // Add authentication logic\n    if (!req.headers.get('authorization')) {\n      res.setError('Unauthorized', {}, [], 401);\n      return false; // Stop processing\n    }\n  });\n}\n```\n\n### Registering Plugins\n\nAdd plugins to your `package.json`:\n\n```json\n{\n  \"plugins\": [\n    \"./src/plugins/auth\",\n    \"./src/plugins/logging\",\n    \"@my-org/ingest-plugin\"\n  ]\n}\n```\n\n### Bootstrapping\n\n```typescript\nimport { server } from '@stackpress/ingest/http';\n\nconst app = server();\n\n// Load all plugins\nawait app.bootstrap();\n\napp.create().listen(3000);\n```\n\n## Event-Driven Architecture\n\nIngest is built on a powerful event system that allows for reactive programming:\n\n```typescript\n// Listen to all requests\napp.on('request', (req, res) =\u003e {\n  console.log(`${req.method} ${req.url.pathname}`);\n});\n\n// Listen to specific routes\napp.on('GET /api/users', (req, res) =\u003e {\n  // This runs for GET /api/users\n});\n\n// Priority-based listeners\napp.on('request', middleware1, 10); // Higher priority\napp.on('request', middleware2, 5);  // Lower priority\n```\n\n## Deployment Examples\n\n### AWS Lambda\n\n```typescript\nimport { server } from '@stackpress/ingest/whatwg';\n\nconst app = server();\napp.get('/api/hello', (req, res) =\u003e {\n  res.setJSON({ message: 'Hello from Lambda!' });\n});\n\nexport const handler = async (event, context) =\u003e {\n  const request = new Request(event.requestContext.http.sourceIp);\n  const response = new Response();\n  return await app.handle(request, response);\n};\n```\n\n### Vercel\n\n```typescript\nimport { server } from '@stackpress/ingest/whatwg';\n\nconst app = server();\napp.get('/api/users', (req, res) =\u003e {\n  res.setJSON({ users: [] });\n});\n\nexport default async function handler(req: Request) {\n  return await app.handle(req, new Response());\n}\n```\n\n### Netlify\n\n```typescript\nimport { server } from '@stackpress/ingest/whatwg';\n\nconst app = server();\napp.get('/.netlify/functions/api', (req, res) =\u003e {\n  res.setJSON({ message: 'Hello from Netlify!' });\n});\n\nexport const handler = async (event, context) =\u003e {\n  const request = new Request(event.rawUrl);\n  const response = new Response();\n  return await app.handle(request, response);\n};\n```\n\n## Build Support\n\nIngest exposes routing information that can be used by bundlers and build tools:\n\n```typescript\nconst app = server();\napp.get('/users', () =\u003e import('./routes/users.js'));\napp.get('/posts', () =\u003e import('./routes/posts.js'));\n\n// Access routing information\nconsole.log(app.routes);    // Route definitions\nconsole.log(app.imports);   // Dynamic imports\nconsole.log(app.entries);   // File entries\nconsole.log(app.views);     // View templates\n```\n\nThis information can be used by bundlers to:\n- Pre-bundle route modules\n- Generate static route manifests\n- Optimize code splitting\n- Create deployment artifacts\n\n## Documentation\n\n- [API Reference](./docs/api/README.md) - Complete API documentation\n- [Examples](./docs/examples.md) - Comprehensive usage examples\n- [Plugin Development](./docs/plugin-development.md) - Guide to creating plugins\n\n## Examples\n\nCheck out the `examples/` directory for complete working examples:\n\n- `with-http` - Basic HTTP server\n- `with-vercel` - Vercel deployment\n- `with-lambda` - AWS Lambda deployment\n- `with-netlify` - Netlify deployment\n- `with-plugins` - Plugin system usage\n- `with-handlebars` - Template engine integration\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackpress%2Fingest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackpress%2Fingest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackpress%2Fingest/lists"}