You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update website documentation to reflect current Echo v4 state
- Updated Go version requirement from 1.13 to 1.20 in quick-start guide
- Enhanced Hello World example with proper middleware setup
- Improved introduction to focus on examples repository purpose
- Added comprehensive example categorization and better resource links
- Enhanced graceful shutdown documentation with implementation details
- Improved JWT authentication cookbook with clearer feature descriptions
- Added CLAUDE.md file for future development guidance
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+
## Project Overview
6
+
7
+
Echo Extra (echox) is a collection of examples and recipes for the Echo web framework in Go. This repository contains:
8
+
9
+
-**cookbook/**: Complete example applications demonstrating various Echo features (22 examples including JWT, CORS, WebSocket, file upload/download, graceful shutdown, etc.)
## Using [http.Server#Shutdown()](https://golang.org/pkg/net/http/#Server.Shutdown)
7
+
This example demonstrates how to implement graceful shutdown using Go's `signal.NotifyContext` and Echo's `Shutdown` method to handle interrupt signals properly.
8
+
9
+
## Using [signal.NotifyContext](https://pkg.go.dev/os/signal#NotifyContext) and [Echo.Shutdown](https://pkg.go.dev/github.com/labstack/echo/v4#Echo.Shutdown)
Copy file name to clipboardExpand all lines: website/docs/cookbook/jwt.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,18 @@
1
1
---
2
-
description: JWT recipe
2
+
description: JWT authentication examples
3
3
---
4
4
5
-
# JWT
5
+
# JWT Authentication
6
6
7
-
[JWT middleware](../middleware/jwt.md) configuration can be found [here](../middleware/jwt.md#configuration).
7
+
This cookbook demonstrates JWT (JSON Web Token) authentication patterns using Echo's JWT middleware. Examples include both basic authentication flows and advanced usage with custom claims and key functions.
8
+
9
+
**Key Features:**
10
+
- JWT authentication using HS256 algorithm
11
+
- Token retrieval from `Authorization` request header
12
+
- Custom claims handling
13
+
- User-defined key functions for advanced scenarios
8
14
9
-
This is cookbook for:
10
-
- JWT authentication using HS256 algorithm.
11
-
- JWT is retrieved from `Authorization` request header.
15
+
[JWT middleware](../middleware/jwt.md) configuration can be found [here](../middleware/jwt.md#configuration).
Copy file name to clipboardExpand all lines: website/docs/guide/quick-start.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,20 +10,14 @@ sidebar_position: 1
10
10
11
11
### Requirements
12
12
13
-
To install Echo [Go](https://go.dev/doc/install) 1.13 or higher is required. Go 1.12 has limited support and some middlewares will not be available. Make sure your project folder is outside your $GOPATH.
13
+
To install Echo [Go](https://go.dev/doc/install) 1.20 or higher is required. Make sure your project folder is outside your $GOPATH and uses Go modules.
14
14
15
15
```sh
16
16
$ mkdir myapp &&cd myapp
17
17
$ go mod init myapp
18
18
$ go get github.com/labstack/echo/v4
19
19
```
20
20
21
-
If you are working with Go v1.14 or earlier use:
22
-
23
-
```sh
24
-
$ GO111MODULE=on go get github.com/labstack/echo/v4
The Echo project is a powerful and versatile web framework for building scalable and high-performance web applications in the Go programming language. It follows the principles of simplicity, flexibility, and performance to provide developers with an efficient toolkit for building robust web applications.
10
+
Echo Examples (echox) provides a comprehensive collection of practical examples and recipes for the Echo web framework. This repository demonstrates real-world usage patterns and best practices for building high-performance web applications with Echo v4.
11
11
12
-
## Key Features
12
+
## What You'll Find Here
13
13
14
-
-**Fast and Lightweight**: Echo is designed for speed and efficiency, ensuring minimal overhead and high performance for handling HTTP requests and responses.
15
-
-**Routing**: The framework offers a flexible and intuitive routing system that allows developers to define routes with parameters, query strings, and custom handlers.
16
-
-**Middleware Support**: Echo provides extensive middleware support, enabling developers to easily implement cross-cutting concerns such as logging, authentication, error handling, and more.
17
-
-**Context-based Request Handling**: With its context-based request handling, Echo offers easy access to request-specific data and parameters, simplifying the development of web applications.
18
-
-**Powerful Template Rendering**: Echo includes a powerful template rendering engine that supports various template languages, allowing developers to generate dynamic HTML content effortlessly.
19
-
-**Validation and Binding**: The framework provides robust validation and data binding capabilities, making it straightforward to validate incoming request data and bind it to Go structs.
20
-
-**Extensibility**: Echo is highly extensible, with support for custom middleware, template engines, and other components, enabling developers to tailor the framework to their specific needs.
21
-
-**Community and Ecosystem**: The Echo project benefits from a vibrant and active community that contributes libraries, plugins, and extensions, fostering an ecosystem of reusable components.
14
+
-**22 Complete Examples**: From basic "Hello World" to advanced features like JWT authentication, WebSocket connections, and graceful shutdown
15
+
-**Real-World Patterns**: Practical implementations of common web development scenarios
16
+
-**Best Practices**: Production-ready code following Echo v4 conventions
17
+
-**Modern Go**: Examples using Go 1.20+ features and current idiomatic patterns
- Community Forum: [https://github.com/labstack/echo/discussions](https://github.com/labstack/echo/discussions)
30
+
1.**Browse Examples**: Explore the cookbook section to find examples relevant to your use case
31
+
2.**Run Locally**: Each example can be run independently with `go run server.go`
32
+
3.**Learn Patterns**: Study the implementation patterns and adapt them to your projects
33
+
34
+
## Resources and Documentation
31
35
32
-
The Echo project offers an array of features that empower developers to build robust web applications. Its fast and lightweight nature ensures optimal performance, while the flexible routing system and middleware support streamline development processes. Developers can leverage the context-based request handling, powerful template rendering, and validation capabilities to create dynamic and secure web applications. Additionally, the extensibility of Echo allows developers to customize and enhance the framework to suit their specific needs.
Join the vibrant community of Echo developers, explore the vast ecosystem of plugins and extensions, and unleash the power of Echo for your web development needs.
42
+
Each example in this collection demonstrates production-ready code that you can use as a foundation for your own applications. The examples cover common web development scenarios and showcase Echo's capabilities in real-world contexts.
0 commit comments