Skip to content

Commit

Permalink
v2.2.x 文档
Browse files Browse the repository at this point in the history
  • Loading branch information
flycash committed May 15, 2024
1 parent b8e9856 commit c26b7d6
Show file tree
Hide file tree
Showing 290 changed files with 16,349 additions and 22 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions docs/en-US/developing/qa/what-is-copy-request-body.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (m *MainController) ReadDataFromBody() {
```

When we access `localhost:8080` and pass in the parameters, we can get the response:
![CopyRequestBody=true](../../../img/qa/copy_request_body_true.png)
![CopyRequestBody=true](./img/qa/copy_request_body_true.png)

If we set `CopyRequestBody` to `false`:

Expand Down Expand Up @@ -68,7 +68,7 @@ func (m *MainController) ReadDataFromBody() {
```

Then we will find that we cannot read the data from inside the request body:
![CopyRequestBody=false](../../../img/qa/copy_request_body_false.png)
![CopyRequestBody=false](./img/qa/copy_request_body_false.png)

So, be aware that you should set `CopyRequestBody` to `true` if you intend to rely on Beego to process the request.

Expand Down
3 changes: 1 addition & 2 deletions docs/en-US/v2.0.x/qa/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Q & A
lang: en-US
sidebar: auto
---

# Q & A
Expand All @@ -10,7 +9,7 @@ We use a lot of commands when answering these questions. In case you find that y

For Windows platforms, we strongly recommend using WSL.

## Web Module
## FAQ - Frequently Asked Questions

- [Why did the web server fail to start?](failed_to_start_web_server.md)
- [What to choose as the receiver for the Controller methods](./choose_func_recever_for_web.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/en-US/v2.0.x/qa/failed_to_start_web_server.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: hy did the web server fail to start?
title: Why did the web server fail to start?
lang: en-US
---

## hy did the web server fail to start?
## Why did the web server fail to start?

The reasons for web server startup can be varied. Generally speaking, it fails because there is a problem with the local environment. web server startup failure generally consists of two parts.

Expand Down
Binary file added docs/en-US/v2.0.x/qa/img/bee_version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/en-US/v2.0.x/qa/what-is-copy-request-body.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: What does CopyRequestBody mean?
lang: en-US
---

# CWhat does CopyRequestBody mean?
# What does CopyRequestBody mean?

In the Beego web configuration, there is a very confusing parameter called `CopyRequestBody`. It is in the structure `web.Config`.

Expand Down Expand Up @@ -39,7 +39,7 @@ func (m *MainController) ReadDataFromBody() {
```

When we access `localhost:8080` and pass in the parameters, we can get the response:
![CopyRequestBody=true](../../../img/qa/copy_request_body_true.png)
![CopyRequestBody=true](./img/qa/copy_request_body_true.png)

If we set `CopyRequestBody` to `false`:

Expand Down Expand Up @@ -68,7 +68,7 @@ func (m *MainController) ReadDataFromBody() {
```

Then we will find that we cannot read the data from inside the request body:
![CopyRequestBody=false](../../../img/qa/copy_request_body_false.png)
![CopyRequestBody=false](./img/qa/copy_request_body_false.png)

So, be aware that you should set `CopyRequestBody` to `true` if you intend to rely on Beego to process the request.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Q & A
lang: en-US
sidebar: auto
---

# Q & A
Expand All @@ -10,7 +9,7 @@ We use a lot of commands when answering these questions. In case you find that y

For Windows platforms, we strongly recommend using WSL.

## Web Module
## FAQ - Frequently Asked Questions

- [Why did the web server fail to start?](failed_to_start_web_server.md)
- [What to choose as the receiver for the Controller methods](./choose_func_recever_for_web.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: hy did the web server fail to start?
title: Why did the web server fail to start?
lang: en-US
---

## hy did the web server fail to start?
## Why did the web server fail to start?

The reasons for web server startup can be varied. Generally speaking, it fails because there is a problem with the local environment. web server startup failure generally consists of two parts.

Expand Down
Binary file added docs/en-US/v2.1.x/qa/img/bee_version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: What does CopyRequestBody mean?
lang: en-US
---

# CWhat does CopyRequestBody mean?
# What does CopyRequestBody mean?

In the Beego web configuration, there is a very confusing parameter called `CopyRequestBody`. It is in the structure `web.Config`.

Expand Down Expand Up @@ -39,7 +39,7 @@ func (m *MainController) ReadDataFromBody() {
```

When we access `localhost:8080` and pass in the parameters, we can get the response:
![CopyRequestBody=true](../../../img/qa/copy_request_body_true.png)
![CopyRequestBody=true](./img/qa/copy_request_body_true.png)

If we set `CopyRequestBody` to `false`:

Expand Down Expand Up @@ -68,7 +68,7 @@ func (m *MainController) ReadDataFromBody() {
```

Then we will find that we cannot read the data from inside the request body:
![CopyRequestBody=false](../../../img/qa/copy_request_body_false.png)
![CopyRequestBody=false](./img/qa/copy_request_body_false.png)

So, be aware that you should set `CopyRequestBody` to `true` if you intend to rely on Beego to process the request.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
129 changes: 129 additions & 0 deletions docs/en-US/v2.2.x/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
title: Quickly Start
lang: en-US
---

# Quickly Start

First make sure you have GO installed, version 1.16 or higher, and that you have set the GOPATH environment variable and added GOPATH/bin to the environment variable.

> We recommend that you simply use the latest stable version, as we try to stay on top of the latest version of Go.
Or you can refer:

[Windows installation](environment/install_go_windows.md)

[Linux installation](environment/install_go_linux.md)

[Mac installation](environment/install_go_mac.md)

**Please note that after `Beego` V2 we require the `go mod` feature, make sure that the `go mod` feature is turned on, i.e. `GO111MODULE=on`**. More details refer to [Go module](environment/go_mod.md)

Or you can specify the GOPROXY:

```shell
GOPROXY=https://goproxy.cn
```

Next, let's try to start a `hello world` example. In this example, we will use the `Bee` tool to create the `hello world` project.

More details refer to [Bee](./bee/README.md)

## Steps

If you already have a development environment installed, then you may consider using our quick install script.

### Mac or Linux

Run:

```shell
bash <(curl -s https://raw.githubusercontent.com/beego/beego-doc/main/scripts/quickstart.sh)
```

Or using wget:

```shell
bash <(wget -qO- https://raw.githubusercontent.com/beego/beego-doc/main/scripts/quickstart.sh)
```

### Windows

Using `curl`

```shell
bash <(curl -s https://raw.githubusercontent.com/beego/beego-doc/main/scripts/quickstart.bat)
```

Or `wget`

```shell
bash <(wget -qO- https://raw.githubusercontent.com/beego/beego-doc/main/scripts/quickstart.bat)
```

## Manual Installation

In this section, we will use the `go get` command, so if you are not familiar with it, we suggest that you read [Go get](environment/go_get_command.md)

Always remember, if you experience network problems, or timeout issues, make sure you set up the `GOPROXY` proxy.

### Install Bee

Run:

```shell
go get -u github.com/beego/bee/v2@latest
```

And then

```shell
bee version
```

you can see:

```shell
| ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
\____/ \___| \___| v2.0.x

├── Beego : Beego is not installed. Please do consider installing it first: https://github.com/beego/beego/v2. If you are using go mod, and you don't install the beego under $GOPATH/src/github.com/beego, just ignore this.
├── GoVersion : go1.16
├── GOOS : linux
├── GOARCH : amd64
├── NumCPU : 12
├── GOPATH : /home/xxx/go
├── GOROOT : /home/aaa/bbb/go
├── Compiler : gc
└── Published : 2020-12-16
```
### Create Project
Run:
```shell
bee new hello
cd hello
go mod tidy
```
And then:
```shell
bee run
```
you can see:
```shell
2021/03/31 23:29:19 SUCCESS ▶ 0004 Built Successfully!
2021/03/31 23:29:19 INFO ▶ 0005 Restarting 'hello'...
2021/03/31 23:29:19 SUCCESS ▶ 0006 './hello' is running...
2021/03/31 23:29:22.016 [I] [parser.go:413] generate router from comments
2021/03/31 23:29:22.016 [I] [server.go:241] http server Running on http://:8080
```
Loading

0 comments on commit c26b7d6

Please sign in to comment.