first commit
This commit is contained in:
		
							
								
								
									
										19
									
								
								internal/test/adapters/http.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								internal/test/adapters/http.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
package adapters
 | 
			
		||||
 | 
			
		||||
import "github.com/gofiber/fiber/v2"
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	router *fiber.Router = nil
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func RegisterRouter(r *fiber.Router) {
 | 
			
		||||
	router = r
 | 
			
		||||
	if router == nil {
 | 
			
		||||
		panic("router is nil")
 | 
			
		||||
	}
 | 
			
		||||
	(*router).Get("/test", test)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func test(c *fiber.Ctx) error {
 | 
			
		||||
	return c.SendString("test")
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user