File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,42 @@ func main(){
233
233
http.ListenAndServe (" :" +port, r)
234
234
}
235
235
```
236
+ ### 6. FastHttp
237
+ ``` go
238
+ mw := kfasthttp.FastHttpMiddleware (k)
239
+ ```
240
+ #### Example
241
+ ``` go
242
+ import (
243
+ " github.com/keploy/go-sdk/integrations/kfasthttp"
244
+ " github.com/keploy/go-sdk/keploy"
245
+ " github.com/valyala/fasthttp"
246
+ )
247
+
248
+ func main () {
249
+ k := keploy.New (keploy.Config {
250
+ App: keploy.AppConfig {
251
+ Name: " fasthttp-URL" ,
252
+ Port: " 8080" ,
253
+ },
254
+ Server: keploy.ServerConfig {
255
+ URL: " http://localhost:8081/api" ,
256
+ },
257
+ })
258
+
259
+ mw := kfasthttp.FastHttpMiddleware (k)
260
+ m := func (ctx *fasthttp.RequestCtx ) {
261
+ switch string (ctx.Path ()) {
262
+ case " /index" :
263
+ index (ctx)
264
+ default :
265
+ ctx.Error (" not found" , fasthttp.StatusNotFound )
266
+ }
267
+ }
268
+ log.Fatal (fasthttp.ListenAndServe (" :8080" , mw (m)))
269
+ }
270
+ ```
271
+
236
272
237
273
## Supported Databases
238
274
### 1. MongoDB
You can’t perform that action at this time.
0 commit comments