@kiyasov/platform-hono 1.5.4 → 1.5.5
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.
package/Readme.md
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
# Hono NestJS Adapter
|
|
1
|
+
# 🚀 Hono NestJS Adapter
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://www.npmjs.com/package/@kiyasov/platform-hono)
|
|
3
|
+
<div align="center">
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@kiyasov/platform-hono)
|
|
6
|
+
[](https://www.npmjs.com/package/@kiyasov/platform-hono)
|
|
7
|
+
[](https://github.com/kiyasov/platform-hono/blob/main/LICENSE)
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
**Use [Hono](https://hono.dev/) with [NestJS](https://nestjs.com/)**
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 📦 Installation
|
|
9
16
|
|
|
10
17
|
```bash
|
|
11
|
-
# npm
|
|
12
18
|
npm install @kiyasov/platform-hono
|
|
19
|
+
```
|
|
13
20
|
|
|
14
|
-
|
|
21
|
+
```bash
|
|
15
22
|
yarn add @kiyasov/platform-hono
|
|
23
|
+
```
|
|
16
24
|
|
|
17
|
-
|
|
25
|
+
```bash
|
|
18
26
|
pnpm add @kiyasov/platform-hono
|
|
27
|
+
```
|
|
19
28
|
|
|
20
|
-
|
|
29
|
+
```bash
|
|
21
30
|
bun add @kiyasov/platform-hono
|
|
22
31
|
```
|
|
23
32
|
|
|
24
|
-
## Quick Start
|
|
25
|
-
|
|
26
|
-
### Basic Setup
|
|
33
|
+
## ⚡ Quick Start
|
|
27
34
|
|
|
28
35
|
```typescript
|
|
29
36
|
import { NestFactory } from '@nestjs/core';
|
|
@@ -31,10 +38,7 @@ import { HonoAdapter } from '@kiyasov/platform-hono';
|
|
|
31
38
|
import { AppModule } from './app.module';
|
|
32
39
|
|
|
33
40
|
async function bootstrap() {
|
|
34
|
-
const app = await NestFactory.create(
|
|
35
|
-
AppModule,
|
|
36
|
-
new HonoAdapter()
|
|
37
|
-
);
|
|
41
|
+
const app = await NestFactory.create(AppModule, new HonoAdapter());
|
|
38
42
|
|
|
39
43
|
await app.listen(3000);
|
|
40
44
|
console.log(`Application is running on: ${await app.getUrl()}`);
|
|
@@ -43,7 +47,7 @@ async function bootstrap() {
|
|
|
43
47
|
bootstrap();
|
|
44
48
|
```
|
|
45
49
|
|
|
46
|
-
## Examples
|
|
50
|
+
## 🎯 Usage Examples
|
|
47
51
|
|
|
48
52
|
### Exception Filter with HonoAdapter
|
|
49
53
|
|
|
@@ -81,48 +85,21 @@ export class AllExceptionsFilter implements ExceptionFilter {
|
|
|
81
85
|
}
|
|
82
86
|
```
|
|
83
87
|
|
|
88
|
+
## 📚 Documentation
|
|
84
89
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
### Custom Hono Instance
|
|
88
|
-
|
|
89
|
-
```typescript
|
|
90
|
-
import { Hono } from 'hono';
|
|
91
|
-
import { cors } from 'hono/cors';
|
|
92
|
-
import { logger } from 'hono/logger';
|
|
93
|
-
|
|
94
|
-
async function bootstrap() {
|
|
95
|
-
const honoApp = new Hono();
|
|
96
|
-
|
|
97
|
-
// Add Hono middleware
|
|
98
|
-
honoApp.use('*', cors());
|
|
99
|
-
honoApp.use('*', logger());
|
|
100
|
-
|
|
101
|
-
const app = await NestFactory.create(
|
|
102
|
-
AppModule,
|
|
103
|
-
new HonoAdapter(honoApp)
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
await app.listen(3000);
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
|
|
90
|
+
For more examples and detailed documentation, check out the [example](./example) directory.
|
|
111
91
|
|
|
112
|
-
|
|
113
|
-
## Contributing
|
|
92
|
+
## 🤝 Contributing
|
|
114
93
|
|
|
115
94
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
116
95
|
|
|
117
|
-
## License
|
|
118
|
-
|
|
119
|
-
MIT
|
|
120
|
-
|
|
121
|
-
## Support
|
|
96
|
+
## 📄 License
|
|
122
97
|
|
|
123
|
-
|
|
98
|
+
MIT © [Islam Kiiasov](https://github.com/kiyasov)
|
|
124
99
|
|
|
125
|
-
##
|
|
100
|
+
## 🔗 Links
|
|
126
101
|
|
|
127
|
-
- [
|
|
128
|
-
- [
|
|
102
|
+
- [NPM Package](https://www.npmjs.com/package/@kiyasov/platform-hono)
|
|
103
|
+
- [GitHub Repository](https://github.com/kiyasov/platform-hono)
|
|
104
|
+
- [Hono Framework](https://hono.dev/)
|
|
105
|
+
- [NestJS Framework](https://nestjs.com/)
|