yinzerflow 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,116 +0,0 @@
1
- # YinzerFlow Documentation
2
-
3
- Welcome to the YinzerFlow documentation! This directory contains comprehensive documentation for the YinzerFlow framework, a lightweight, modular HTTP server framework for Node.js built with TypeScript.
4
-
5
- ## Contents
6
-
7
- - [Routing System](./routing.md) - Comprehensive guide to the routing system, including route definition, parameters, and groups.
8
- - [Request Lifecycle Hooks](./hooks.md) - In-depth documentation of the hooks system for intercepting and modifying requests.
9
- - [Request Object](./request.md) - Complete guide to request properties: headers, body, query parameters, route parameters, and security features.
10
- - [CORS Configuration](./cors.md) - Cross-Origin Resource Sharing setup and security considerations.
11
- - [Error Handling](./error-handling.md) - Guide to handling errors at different levels in your application.
12
-
13
- ## Getting Started
14
-
15
- If you're new to YinzerFlow, we recommend starting with the examples in the `/example` directory:
16
-
17
- - [TypeScript Example](/example/typescript/README.md) - A type-safe server implementation in TypeScript
18
-
19
- ### Installation
20
-
21
- You can install YinzerFlow using your preferred package manager:
22
-
23
- ```bash
24
- # Using npm
25
- npm install yinzerflow
26
-
27
- # Using Yarn
28
- yarn add yinzerflow
29
-
30
- # Using Bun
31
- bun add yinzerflow
32
- ```
33
-
34
- ### Quick Start
35
-
36
- Here's a minimal example to get a server up and running:
37
-
38
- ```typescript
39
- import { YinzerFlow } from 'yinzerflow';
40
-
41
- // Create a new YinzerFlow instance
42
- const app = new YinzerFlow({ port: 3000 });
43
-
44
- // Add a simple route
45
- app.get('/hello', () => {
46
- return { message: 'Hello, World!' };
47
- });
48
-
49
- // Start the server
50
- await app.listen();
51
- const { port, isListening } = app.getStatus();
52
-
53
- if (isListening) console.log(`Server running on http://localhost:${port}`);
54
- ```
55
-
56
- #### Graceful Shutdown
57
-
58
- To implement graceful shutdown in your application:
59
-
60
- ```typescript
61
- // Graceful shutdown example
62
- process.on('SIGTERM', async () => {
63
- console.log('SIGTERM received, shutting down gracefully');
64
-
65
- // This will:
66
- // 1. Stop accepting new connections
67
- // 2. Wait for existing connections to complete (up to the configured timeout)
68
- // 3. Close the server
69
- await app.close();
70
-
71
- console.log('Server shut down gracefully');
72
- process.exit(0);
73
- });
74
-
75
- app.listen();
76
- console.log('Server running on http://localhost:3000');
77
- ```
78
-
79
- The `close()` method handles the entire shutdown process, including:
80
- - Stopping the server from accepting new connections
81
- - Waiting for existing connections to finish (respecting the configured timeout)
82
- - Closing all remaining connections and the server itself
83
-
84
- This ensures that your application can shut down cleanly without abruptly terminating active connections.
85
-
86
- ## Contributing to Documentation
87
-
88
- We welcome contributions to improve this documentation! If you find any issues or have suggestions for improvements, please feel free to submit a pull request.
89
-
90
- When contributing to documentation:
91
-
92
- 1. Use clear, concise language
93
- 2. Include code examples where appropriate
94
- 3. Follow Markdown best practices
95
- 4. Test all links to ensure they work correctly
96
-
97
- ## Documentation Structure
98
-
99
- The documentation is organized as follows:
100
-
101
- ```
102
- docs/
103
- ├── start-here.MD # This file - overview and getting started
104
- ├── routing.md # Comprehensive guide to the routing system
105
- ├── hooks.md # In-depth documentation of the hooks system
106
- ├── request.md # Request object: headers, body, query, params, and security
107
- ├── cors.md # CORS configuration and security considerations
108
- ├── content-types.md # Working with different content types
109
- ├── error-handling.md # Guide to handling errors at different levels in your application
110
- ```
111
-
112
- Additional documentation files will be added as the framework evolves, including:
113
-
114
- - Performance optimization guides
115
- - Deployment strategies
116
- - Troubleshooting and FAQs