GopherLight v0.2 Release Notes
π GopherLight v0.2 - Enhanced Routing and Middleware Support!
We are excited to announce the second version of GopherLight, bringing more flexibility and features to our lightweight Go framework. With this update, youβll experience a more powerful routing system and the addition of convenient middleware to streamline your development process.
π― Additions
- Support for Multiple HTTP Methods: GopherLight now allows routing for various HTTP methods such as GET, POST, PUT, DELETE, and more. You can define routes for each specific method, increasing flexibility in handling requests.
app.Route("POST", "/submit", func(r *req.Request, w *req.Response) {
w.Send("Data received!")
})
Logging Middleware: Automatically log the start and completion time of each request, making it easier to debug and monitor the behavior of your app.
Timeout Middleware: Prevent long-running requests from blocking your application with the newly introduced timeout middleware. You can set time limits for your request handling.
app.Use(middleware.LoggingMiddleware)
app.Use(middleware.TimeoutMiddleware(2 * time.Second))
π οΈ Improvements
-
HTTP Method Validation: We've implemented stricter validation for HTTP methods. Now, your routes will only respond to the defined methods, ensuring security and better management of requests.
π Changes
Route Function Refactoring: The route function has been restructured to handle multiple HTTP methods efficiently, improving performance and code clarity.
-
Documentation Update: The documentation has been updated to reflect all the new features, including detailed examples of how to utilize multiple HTTP methods and middleware in your application.
π Whatβs Next?
Enhanced error handling and better integration with third-party services.
Middleware for authentication and CSRF protection.π Contributions GopherLight continues to grow with your support! We welcome contributions, suggestions, and improvements from the community. Feel free to explore, submit issues, or open PRs to make the framework even better.