Skip to content

Commit d153184

Browse files
committed
update readme
1 parent da0f989 commit d153184

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

readme.md

+25-25
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,24 @@ func main() {
3939
// Initialize the application
4040
New()
4141

42-
Config.AddConfig("App", new(AppConfig)).Load()
43-
42+
Config.AddConfig("App", new(AppConfig)).Load()
43+
4444
// artifact.Start() // Database connection will be established here
45-
46-
Router.GET("/", func(c *gin.Context) {
47-
data := map[string]interface{}{
48-
"app": Config.GetString("App.Name"),
49-
}
50-
51-
//or
52-
//data := gin.H{
53-
// "message": "Hello World",
54-
//}
55-
56-
Res.Status(200).
57-
Message("success").
58-
Data(data).Json(c)
59-
})
45+
46+
Router.GET("/", func(c *gin.Context) {
47+
data := map[string]interface{}{
48+
"app": Config.GetString("App.Name"),
49+
}
50+
51+
//or
52+
//data := gin.H{
53+
// "message": "Hello World",
54+
//}
55+
56+
Res.Status(200).
57+
Message("success").
58+
Data(data).Json(c)
59+
})
6060

6161
Run()
6262
}
@@ -84,7 +84,7 @@ package main
8484
import "github.com/shipu/artifact/cmd"
8585

8686
func main() {
87-
cmd.Execute()
87+
cmd.Execute()
8888
}
8989
```
9090
Run below command to generate crud.
@@ -114,12 +114,12 @@ Suppose your config is `config/db.go`:
114114
package config
115115

116116
type DatabaseConfig struct {
117-
Username string `mapstructure:"DB_USER" default:""`
118-
Password string `mapstructure:"DB_PASS" default:""`
119-
Host string `mapstructure:"DB_HOST" default:""`
120-
Port string `mapstructure:"DB_PORT" default:""`
121-
Database string `mapstructure:"DB_DATABASE" default:""`
122-
Connection string `mapstructure:"DB_CONNECTION" default:""`
117+
Username string `mapstructure:"DB_USER" default:""`
118+
Password string `mapstructure:"DB_PASS" default:""`
119+
Host string `mapstructure:"DB_HOST" default:""`
120+
Port string `mapstructure:"DB_PORT" default:""`
121+
Database string `mapstructure:"DB_DATABASE" default:""`
122+
Connection string `mapstructure:"DB_CONNECTION" default:""`
123123
}
124124
```
125125
and your `.env` is:
@@ -205,7 +205,7 @@ data := map[string]interface{}{
205205
Res.Status(200).
206206
Message("Success").
207207
Data(data).
208-
Json(c)
208+
Json(c)
209209
```
210210

211211
`Res` Api Methods:

0 commit comments

Comments
 (0)