Skip to content

Commit

Permalink
Update v1.8.3 (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
hwbrzzl authored Feb 7, 2023
1 parent af47337 commit d85c3df
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
26 changes: 26 additions & 0 deletions the-basics/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,32 @@ func main() {
}
```

## Start HTTPS Server

### Register Middleware

Framework has a general middleware built in, you can also customize it according to your own needs.

```go
// app/http/kernel.go
import "github.com/goravel/framework/http/middleware"

func (kernel *Kernel) Middleware() []http.Middleware {
return []http.Middleware{
middleware.Tls(facades.Config.GetString("app.host")),
}
}
```

### Start Server

```go
// main.go
if err := facades.Route.RunTLS(facades.Config.GetString("app.host"), "ca.pem", "ca.key"); err != nil {
facades.Log.Errorf("Route run error: %v", err)
}
```

### Routing Methods

| Methods | Action |
Expand Down
9 changes: 8 additions & 1 deletion upgrade/v1.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [Add methods for Request(1.8.0)](#Add-methods-for-Request)
- [Add methods for Response(1.8.0)](#Add-methods-for-Response)
- [Optimize database migrate(1.8.0)](#Optimize-database-migrate)
- [Route supports HTTPS(1.8.3)](#Route-supports-HTTPS)

## Breaking Changes 🛠

Expand All @@ -33,7 +34,7 @@
Update dependencies in the `go.mod` file:

```
go get -u github.com/goravel/framework@v1.8.1
go get -u github.com/goravel/framework@v1.8.3
```

### Add model association for Orm
Expand Down Expand Up @@ -169,3 +170,9 @@ When high concurrent access, reading `facades.Orm` for the first time may return
Version: v1.8.2

You can send mail by 25, 465, 587 ports now.

### Route supports HTTPS

Version: v1.8.3

`facades.Route` Add `RunTLS` method,support start HTTPS server, [For Detail](../the-basics/routing.md#start-https-server).
26 changes: 26 additions & 0 deletions zh/the-basics/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,32 @@ func main() {
}
```

## 启动 HTTPS 服务器

### 注册中间件

框架内置了一个通用的中间件,您也可以根据自己需求进行自定义。

```go
// app/http/kernel.go
import "github.com/goravel/framework/http/middleware"

func (kernel *Kernel) Middleware() []http.Middleware {
return []http.Middleware{
middleware.Tls(facades.Config.GetString("app.host")),
}
}
```

### 启动服务器

```go
// main.go
if err := facades.Route.RunTLS(facades.Config.GetString("app.host"), "ca.pem", "ca.key"); err != nil {
facades.Log.Errorf("Route run error: %v", err)
}
```

### 路由方法

| 方法 | 作用 |
Expand Down
9 changes: 8 additions & 1 deletion zh/upgrade/v1.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [Request 新增方法(1.8.0)](#Request-新增方法)
- [Response 新增方法(1.8.0)](#Response-新增方法)
- [优化数据库迁移(1.8.0)](#优化数据库迁移)
- [Route 支持 HTTPS(1.8.3)](#Route-支持-HTTPS)

## 破坏性变化 🛠

Expand All @@ -33,7 +34,7 @@
`go.mod` 中更新依赖:

```
go get -u github.com/goravel/framework@v1.8.1
go get -u github.com/goravel/framework@v1.8.3
```

### Orm 新增模型关联
Expand Down Expand Up @@ -169,3 +170,9 @@ Version: v1.8.1
Version: v1.8.2

您现在可以使用 25,465,587 发送邮件了。

### Route 支持 HTTPS

Version: v1.8.3

`facades.Route` 新增 `RunTLS` 方法,支持启动 HTTPS 服务器,详见[文档](../the-basics/routing.md#启动-https-服务器)

0 comments on commit d85c3df

Please sign in to comment.