diff --git a/.gitignore b/.gitignore
index a81172a..2399d1d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -132,6 +132,4 @@ archives
.http
.vercel
.netlify
-examples/with-vercel/api
-examples/with-vercel/vercel.json
.DS_Store
\ No newline at end of file
diff --git a/examples/with-entries/icon.png b/examples/with-entries/icon.png
new file mode 100644
index 0000000..a6b9fd3
Binary files /dev/null and b/examples/with-entries/icon.png differ
diff --git a/examples/with-entries/package.json b/examples/with-entries/package.json
new file mode 100644
index 0000000..09e5ecc
--- /dev/null
+++ b/examples/with-entries/package.json
@@ -0,0 +1,21 @@
+{
+ "name": "ingest-with-entries",
+ "version": "1.0.0",
+ "description": "A simple boilerplate for using Ingest with plugins.",
+ "private": true,
+ "plugins": [
+ "./src/plugin"
+ ],
+ "scripts": {
+ "build": "tsc",
+ "dev": "ts-node src/scripts/serve.ts"
+ },
+ "dependencies": {
+ "@stackpress/ingest": "0.3.6"
+ },
+ "devDependencies": {
+ "@types/node": "22.9.3",
+ "ts-node": "10.9.2",
+ "typescript": "5.7.2"
+ }
+}
\ No newline at end of file
diff --git a/examples/with-entries/src/config.ts b/examples/with-entries/src/config.ts
new file mode 100644
index 0000000..80b5c0e
--- /dev/null
+++ b/examples/with-entries/src/config.ts
@@ -0,0 +1,24 @@
+import type { CookieOptions } from '@stackpress/ingest';
+
+export const environment = process.env.SERVER_ENV || 'development';
+export const config: Config = {
+ server: {
+ cwd: process.cwd(),
+ mode: environment,
+ bodySize: 0
+ },
+ cookie: { path: '/' },
+ body: { size: 0 }
+};
+
+export type Config = {
+ server: {
+ cwd: string,
+ mode: string,
+ bodySize: number
+ },
+ cookie: CookieOptions,
+ body: {
+ size: number
+ }
+};
\ No newline at end of file
diff --git a/examples/with-entries/src/error.ts b/examples/with-entries/src/error.ts
new file mode 100644
index 0000000..20ad1f7
--- /dev/null
+++ b/examples/with-entries/src/error.ts
@@ -0,0 +1,3 @@
+export default function ShouldNotWork(message: string) {
+ throw new Error(message);
+};
\ No newline at end of file
diff --git a/examples/with-entries/src/events/error.ts b/examples/with-entries/src/events/error.ts
new file mode 100644
index 0000000..fa4f9d3
--- /dev/null
+++ b/examples/with-entries/src/events/error.ts
@@ -0,0 +1,14 @@
+import { ServerRequest, Response } from '@stackpress/ingest';
+
+export default function Error(req: ServerRequest, res: Response) {
+ const html = [ `
${res.error}
` ];
+ const stack = res.stack?.map((log, i) => {
+ const { line, char } = log;
+ const method = log.method.replace(//g, ">");
+ const file = log.file.replace(//g, ">");
+ return `#${i + 1} ${method} - ${file}:${line}:${char}`;
+ }) || [];
+ html.push(`${stack.join('
')}`);
+
+ res.setHTML(html.join('
'));
+}
\ No newline at end of file
diff --git a/examples/with-entries/src/plugin.ts b/examples/with-entries/src/plugin.ts
new file mode 100644
index 0000000..edaf4d2
--- /dev/null
+++ b/examples/with-entries/src/plugin.ts
@@ -0,0 +1,34 @@
+import type { HTTPServer } from '@stackpress/ingest';
+import type { Config } from './config';
+
+import path from 'path';
+import { config } from './config';
+
+export default function plugin(server: HTTPServer) {
+ server.config.set(config);
+
+ server.get('/', path.join(__dirname, 'routes/home'));
+ server.get('/login', path.join(__dirname, 'routes/login'));
+
+ server.get('/user', path.join(__dirname, 'routes/user/search'));
+ server.post('/user', path.join(__dirname, 'routes/user/create'));
+ server.get('/user/:id', path.join(__dirname, 'routes/user/detail'));
+ server.put('/user/:id', path.join(__dirname, 'routes/user/update'));
+ server.delete('/user/:id', path.join(__dirname, 'routes/user/remove'));
+
+ server.get('/redirect', path.join(__dirname, 'routes/redirect'));
+ server.get('/icon.png', path.join(__dirname, 'routes/icon'));
+ server.get('/stream', path.join(__dirname, 'routes/stream'));
+ server.get('/__sse__', path.join(__dirname, 'routes/sse'));
+
+ server.get('/error', path.join(__dirname, 'routes/error'));
+ server.get('/catch', path.join(__dirname, 'routes/catch'));
+ server.get('/**', path.join(__dirname, 'routes/404'));
+
+ server.on('error', path.join(__dirname, 'events/error'));
+
+ server.register('project', { welcome: 'Hello, World!!' });
+ server.on('request', (req, res) => {
+ console.log('Request:', req.url);
+ });
+}
\ No newline at end of file
diff --git a/examples/with-entries/src/routes/404.ts b/examples/with-entries/src/routes/404.ts
new file mode 100644
index 0000000..b7dbfc0
--- /dev/null
+++ b/examples/with-entries/src/routes/404.ts
@@ -0,0 +1,8 @@
+import { ServerRequest, Response } from '@stackpress/ingest';
+
+export default function NotFound(req: ServerRequest, res: Response) {
+ if (!res.code && !res.status && !res.sent) {
+ //send the response
+ res.setHTML('Not Found');
+ }
+};
\ No newline at end of file
diff --git a/examples/with-plugins/src/routes/error.ts b/examples/with-entries/src/routes/catch.ts
similarity index 59%
rename from examples/with-plugins/src/routes/error.ts
rename to examples/with-entries/src/routes/catch.ts
index c84fafd..2f64a34 100644
--- a/examples/with-plugins/src/routes/error.ts
+++ b/examples/with-entries/src/routes/catch.ts
@@ -1,6 +1,6 @@
-import { Context, Response, Exception } from '@stackpress/ingest';
+import { ServerRequest, Response, Exception } from '@stackpress/ingest';
-export default function ErrorResponse(req: Context, res: Response) {
+export default function ErrorResponse(req: ServerRequest, res: Response) {
try {
throw Exception.for('Not implemented');
} catch (e) {
diff --git a/examples/with-entries/src/routes/error.ts b/examples/with-entries/src/routes/error.ts
new file mode 100644
index 0000000..ba12634
--- /dev/null
+++ b/examples/with-entries/src/routes/error.ts
@@ -0,0 +1,6 @@
+import { ServerRequest, Response } from '@stackpress/ingest';
+import Error from '../error';
+
+export default function ErrorResponse(req: ServerRequest, res: Response) {
+ Error('Not implemented');
+};
\ No newline at end of file
diff --git a/examples/with-entries/src/routes/home.ts b/examples/with-entries/src/routes/home.ts
new file mode 100644
index 0000000..6a819b7
--- /dev/null
+++ b/examples/with-entries/src/routes/home.ts
@@ -0,0 +1,6 @@
+import { ServerRequest, Response } from '@stackpress/ingest';
+
+export default async function HomePage(req: ServerRequest, res: Response) {
+ const project = req.context.plugin<{ welcome: string }>('project');
+ res.setHTML(project.welcome);
+};
\ No newline at end of file
diff --git a/examples/with-netlify/src/routes/icon.ts b/examples/with-entries/src/routes/icon.ts
similarity index 64%
rename from examples/with-netlify/src/routes/icon.ts
rename to examples/with-entries/src/routes/icon.ts
index ae6b9fd..7c8ac5b 100644
--- a/examples/with-netlify/src/routes/icon.ts
+++ b/examples/with-entries/src/routes/icon.ts
@@ -1,8 +1,8 @@
import fs from 'fs';
import path from 'path';
-import { Context, Response } from '@stackpress/ingest';
+import { ServerRequest, Response } from '@stackpress/ingest';
-export default async function Icon(req: Context, res: Response) {
+export default async function Icon(req: ServerRequest, res: Response) {
if (res.code || res.status || res.body) return;
const file = path.resolve(process.cwd(), 'icon.png');
if (fs.existsSync(file)) {
diff --git a/examples/with-vercel/src/routes/login.ts b/examples/with-entries/src/routes/login.ts
similarity index 80%
rename from examples/with-vercel/src/routes/login.ts
rename to examples/with-entries/src/routes/login.ts
index e01af9b..9fa846c 100644
--- a/examples/with-vercel/src/routes/login.ts
+++ b/examples/with-entries/src/routes/login.ts
@@ -1,4 +1,4 @@
-import { Context, Response } from '@stackpress/ingest';
+import { ServerRequest, Response } from '@stackpress/ingest';
const template = `
@@ -19,7 +19,7 @@ const template = `