Skip to content

Commit 0273e08

Browse files
committed
readme updated.
1 parent 2518ebc commit 0273e08

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

README.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,12 @@ openssl rsa -in ./keys/private.pem -outform PEM -pubout -out ./keys/public.pem
5757
# after generating keys, you can set as environment variables
5858
export JWT_PRIVATE_KEY=$(cat ./keys/private.pem)
5959
export JWT_PUBLIC_KEY=$(cat ./keys/public.pem)
60+
export CGO_ENABLED=0
61+
exprot LOGS_DATABASE="postgresql://user:pass@localhost/logs?sslmode=disable"
62+
export DATABASE="postgresql://user:pass@localhost/postgres?sslmode=disable"
6063

6164
# export is success you can run the project ✅
62-
63-
# run the project with postgres connection info
64-
CGO_ENABLED=0 \
65-
LOGS_DATABASE="postgresql://user:pass@localhost/logs?sslmode=disable" \
66-
DATABASE="postgresql://user:pass@localhost/postgres?sslmode=disable" \
67-
go run -tags pq ./examples/base serve
65+
go run -tags pq ./examples/base serve
6866

6967
```
7068

@@ -108,19 +106,34 @@ import (
108106

109107
pocketbase "github.com/AlperRehaYAZGAN/postgresbase" // ! Just change the import path
110108
"github.com/AlperRehaYAZGAN/postgresbase/core" // ! Just change the import path
111-
"github.com/AlperRehaYAZGAN/postgresbase/plugins/migratecmd" // ! Just change the import path
112109
)
113110

114111
func main() {
115112
app := pocketbase.New()
116113

117-
app.OnAfterBootstrap().PreAdd(func(e *core.BootstrapEvent) error {
118-
app.Dao().ModelQueryTimeout = time.Duration(queryTimeout) * time.Second
119-
return nil
120-
})
114+
// TODO: Add your own plugins, logic or any pocketbase supported features
115+
// ...
121116

122117
if err := app.Start(); err != nil {
123118
log.Fatal(err)
124119
}
125120
}
126121
```
122+
123+
- You could run app with following command:
124+
```bash
125+
# before running application generate RSA256 public-private key pair for jwt signing
126+
# you can use following command to generate RSA key pair
127+
openssl genrsa -out ./keys/private.pem 2048
128+
openssl rsa -in ./keys/private.pem -outform PEM -pubout -out ./keys/public.pem
129+
130+
# set required environment variables
131+
export JWT_PRIVATE_KEY=$(cat ./keys/private.pem)
132+
export JWT_PUBLIC_KEY=$(cat ./keys/public.pem)
133+
export CGO_ENABLED=0
134+
export LOGS_DATABASE="postgresql://user:pass@localhost/logs?sslmode=disable"
135+
export DATABASE="postgresql://user:pass@localhost/postgres?sslmode=disable"
136+
137+
# run the application
138+
go run -tags pq main.go serve --http=0.0.0.0:8090
139+
```

0 commit comments

Comments
 (0)