mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 17:42:24 +08:00

Serve runtime from assetserver if requested. Add gin guide, fix asset server merge, add gin example adding http.CloseNotifier and http.Flusher interface to assetserver.contentTypeSniffer, for Gin (and other framework) compatibility.
27 lines
675 B
Markdown
27 lines
675 B
Markdown
# Gin Routing Example
|
|
|
|
This example demonstrates how to use the [Gin web framework](https://github.com/gin-gonic/gin) as a router with Wails.
|
|
|
|
## Overview
|
|
|
|
This example shows how to:
|
|
|
|
- Set up Gin as the asset handler for a Wails application
|
|
- Create a middleware that routes requests between Wails and Gin
|
|
- Define API endpoints with Gin
|
|
- Communicate between the Gin-served frontend and Wails backend
|
|
- Implement custom Gin middleware
|
|
|
|
## Running the Example
|
|
|
|
```bash
|
|
cd v3/examples/gin-routing
|
|
go mod tidy
|
|
go run .
|
|
```
|
|
|
|
## Documentation
|
|
|
|
Please consult the [Using Gin for Routing](https://v3.wails.io/guides/gin-routing/) guide for a detailed explanation of the example.
|
|
|