Checkout this blog for http2 support in lb4 app: https://blog.shubhamp.dev/how-to-use-http2-in-loopback-4-applications Related Thread: loopbackio/loopback-next#9067
Proxy code for forwarding HTTP2 requests to loopback, in two ways:
- Internal node:http2
- Fastify's http2 server
.
├── loopback-http2-proxy/ (• this repository)
│ └── src
│ ├── native-http2.ts
| └── H2 Server having requests forwarded to lb4 app using node's internal http2.
│ └── fastify-http2.ts
| └── H2 Server having requests forwarded to lb4 app using fastify.
└── default-app/ (loopback app to forward requests to)
└── (...normal loopback app)
TODO
- GET routes with returned responses
- GET routes with responses send() directly to http by loopback.
- Translated http/1 Headers
- Cookies
- Status Codes
- Static Responses (to support
this.static('/', "index.html")
) - Streamed Responses (
Readable
streams) - ...(more to come)
An lb4 app sourced here is being used to test different routes and responses.
-
REST Controller with CRUD functions (Datasource: Postgres) source
-
@post('/users')
-
@get('/users')
-
@get('/users/count')
-
@patch('/users')
-
@get('/users/{id}')
-
@patch('/users/{id}')
-
@put('/users/{id}')
-
@del('/users/{id}')
-
-
Default Ping Controller