@@ -57,14 +57,12 @@ openssl rsa -in ./keys/private.pem -outform PEM -pubout -out ./keys/public.pem
57
57
# after generating keys, you can set as environment variables
58
58
export JWT_PRIVATE_KEY=$( cat ./keys/private.pem)
59
59
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"
60
63
61
64
# 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
68
66
69
67
```
70
68
@@ -108,19 +106,34 @@ import (
108
106
109
107
pocketbase " github.com/AlperRehaYAZGAN/postgresbase" // ! Just change the import path
110
108
" github.com/AlperRehaYAZGAN/postgresbase/core" // ! Just change the import path
111
- " github.com/AlperRehaYAZGAN/postgresbase/plugins/migratecmd" // ! Just change the import path
112
109
)
113
110
114
111
func main () {
115
112
app := pocketbase.New ()
116
113
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
+ // ...
121
116
122
117
if err := app.Start (); err != nil {
123
118
log.Fatal (err)
124
119
}
125
120
}
126
121
```
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