fix minor bug, add todos
This commit is contained in:
11
README.md
11
README.md
@@ -56,6 +56,17 @@ To terminate the current server simply press `CTRL-C`.
|
||||
|
||||
<img src="./.github/docs/examples.png" alt="examples" width="1000"/>
|
||||
|
||||
## 🐛 Known TODOs / Bugs
|
||||
|
||||
* [ ] GitHub alert block
|
||||
```md
|
||||
> [!NOTE]
|
||||
> Useful information that users should know, even when skimming content.
|
||||
```
|
||||
* [ ] Checkboxes (like in this todo list)
|
||||
* [ ] Tests and refactoring
|
||||
|
||||
|
||||
## 📌 Similar tools
|
||||
|
||||
This tool is, like the name already says, a reimplementation of [grip](https://github.com/joeyespo/grip) in go and without using the web API of GitHub.
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"path"
|
||||
"net/url"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"text/template"
|
||||
@@ -52,7 +52,7 @@ func (client *Client) Serve(file string) error {
|
||||
}
|
||||
})
|
||||
|
||||
addr := fmt.Sprintf("http://localhost:%d", client.Port)
|
||||
addr := fmt.Sprintf("http://localhost:%d/", client.Port)
|
||||
if file == "" {
|
||||
// If README.md exists then open README.md at beginning
|
||||
readme := "README.md"
|
||||
@@ -61,10 +61,10 @@ func (client *Client) Serve(file string) error {
|
||||
defer f.Close()
|
||||
}
|
||||
if err == nil && client.OpenReadme {
|
||||
addr = path.Join(addr, readme)
|
||||
addr, _ = url.JoinPath(addr, readme)
|
||||
}
|
||||
} else {
|
||||
addr = path.Join(addr, file)
|
||||
addr, _ = url.JoinPath(addr, file)
|
||||
}
|
||||
|
||||
fmt.Printf("🚀 Starting server: %s\n", addr)
|
||||
|
||||
Reference in New Issue
Block a user