able to fetch the ngrok executable path through a 'NGROK' env variable as well, and humanize the returned error

Former-commit-id: 8a61ed64b64e18bd2beb938ccb38150f2090ec54
This commit is contained in:
Gerasimos (Makis) Maropoulos 2019-07-19 12:55:57 +03:00
parent 452b7d2df0
commit ac86d687c3
3 changed files with 21 additions and 17 deletions

4
FAQ.md
View File

@ -24,7 +24,7 @@ Add a `badge` to your open-source projects powered by [Iris](https://iris-go.com
go get -u github.com/kataras/iris
```
Go installed version 1.12 and above is required.
Go version 1.12 and above is required.
## Learning
@ -60,4 +60,4 @@ Yes, https://chat.iris-go.com
By normal people, like you, who help us by donating small or large amounts of money.
Help this project deliver awesome and unique features with the highest possible code quality by donating any amount via [PayPal](https://www.paypal.me/kataras). Your name will be published [here](https://iris-go.com/donate) after your approval via e-mail.
Help this project deliver awesome and unique features with the highest possible code quality by donating any amount via [PayPal](https://www.paypal.me/kataras). Your name will be published [here](https://iris-go.com) after your approval via e-mail.

View File

@ -47,28 +47,21 @@ Iris does not force you to use any specific ORM or template engine. With support
The only requirement is the [Go Programming Language](https://golang.org/dl/), version 1.12 and above.
```sh
$ go get github.com/kataras/iris
$ go get github.com/kataras/iris@v11.2.0
```
<details>
<summary>Known issues for code editors and IDEs at general</summary>
Or inside your `go.mod` file:
### VS Code
```sh
module your_project_name
For some reason the latest [vscode-go language extension](https://github.com/Microsoft/vscode-go) does not provide enough intelligence for the `iris.Context` type alias (input parameters documentation and definition navigation).
Probably you have already experienced this issue with other Go libraries too, it is not an iris-specific issue, it is a general issue for all Golang type aliases.
go 1.12
Therefore if you use [VS Code](https://code.visualstudio.com/) and you need these editor's features, import the original path; add an extra import statement of the original path of the `Context`, that will do it:
```go
import (
"github.com/kataras/iris"
"github.com/kataras/iris/context" // <- HERE
require (
github.com/kataras/iris v11.2.0
)
```
</details>
## Quick start
```sh

View File

@ -461,7 +461,18 @@ func (tc TunnelingConfiguration) startTunnel(t Tunnel, publicAddr *string) error
if !tc.isNgrokRunning() {
ngrokBin := "ngrok" // environment binary.
if tc.Bin != "" {
if tc.Bin == "" {
_, err := exec.LookPath(ngrokBin)
if err != nil {
ngrokEnvVar, found := os.LookupEnv("NGROK")
if !found {
return fmt.Errorf(`"ngrok" executable not found, please install it from: https://ngrok.com/download`)
}
ngrokBin = ngrokEnvVar
}
} else {
ngrokBin = tc.Bin
}