mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-10 06:29:52 +00:00
Merge pull request #236 from liburdi/docs/upd_readme
feat: reamdme里面的源码启动命令已经失效,因为ui/dist不在代码仓库中管理
This commit is contained in:
commit
5f62c887c0
3
Makefile
3
Makefile
@ -35,3 +35,6 @@ help:
|
||||
@echo " make help - 显示此帮助信息"
|
||||
|
||||
.PHONY: all build clean help
|
||||
|
||||
local.run:
|
||||
go mod vendor&& npm --prefix ./ui install && npm --prefix ./ui run build && go run main.go serve --http 127.0.0.1:8090
|
||||
|
@ -55,8 +55,7 @@ mkdir -p ~/.certimate && cd ~/.certimate && curl -O https://raw.githubuserconten
|
||||
```bash
|
||||
git clone EMAIL:usual2970/certimate.git
|
||||
cd certimate
|
||||
go mod vendor
|
||||
go run main.go serve
|
||||
make local.run
|
||||
```
|
||||
|
||||
## 二、使用
|
||||
|
@ -54,8 +54,7 @@ mkdir -p ~/.certimate && cd ~/.certimate && curl -O https://raw.githubuserconten
|
||||
```bash
|
||||
git clone EMAIL:usual2970/certimate.git
|
||||
cd certimate
|
||||
go mod vendor
|
||||
go run main.go serve
|
||||
make local.run
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
12
main.go
12
main.go
@ -1,7 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/usual2970/certimate/ui"
|
||||
"flag"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
@ -16,6 +16,7 @@ import (
|
||||
"github.com/usual2970/certimate/internal/domains"
|
||||
"github.com/usual2970/certimate/internal/routes"
|
||||
"github.com/usual2970/certimate/internal/utils/app"
|
||||
"github.com/usual2970/certimate/ui"
|
||||
|
||||
_ "time/tzdata"
|
||||
)
|
||||
@ -25,6 +26,12 @@ func main() {
|
||||
|
||||
isGoRun := strings.HasPrefix(os.Args[0], os.TempDir())
|
||||
|
||||
// 获取启动命令中的http参数
|
||||
var httpFlag string
|
||||
flag.StringVar(&httpFlag, "http", "127.0.0.1:8090", "HTTP server address")
|
||||
// "serve"影响解析
|
||||
_ = flag.CommandLine.Parse(os.Args[2:])
|
||||
|
||||
migratecmd.MustRegister(app, app.RootCmd, migratecmd.Config{
|
||||
// enable auto creation of migration files when making collection changes in the Admin UI
|
||||
// (the isGoRun check is to enable it only during development)
|
||||
@ -47,6 +54,9 @@ func main() {
|
||||
return nil
|
||||
})
|
||||
|
||||
defer log.Println("Exit!")
|
||||
log.Printf("Visit the website: http://%s", httpFlag)
|
||||
|
||||
if err := app.Start(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user