-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdemo.go
More file actions
27 lines (23 loc) · 686 Bytes
/
demo.go
File metadata and controls
27 lines (23 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package env
import (
"os"
"github.com/bastean/codexgo/v4/pkg/context/shared/domain/errors"
)
func InitDemo() error {
if err := errors.Join(
os.Setenv(JWT_SECRET_KEY, "codexgo-demo"),
os.Setenv(SERVER_GIN_HOSTNAME, "localhost"),
os.Setenv(SERVER_GIN_PORT, "8080"),
os.Setenv(SERVER_GIN_URL, "http://localhost:8080"),
os.Setenv(SERVER_GIN_MODE, "release"),
os.Setenv(SERVER_GIN_ALLOWED_HOSTS, "localhost:8080"),
os.Setenv(SERVER_GIN_COOKIE_SECRET_KEY, "codexgo-demo"),
os.Setenv(SERVER_GIN_COOKIE_SESSION_NAME, "codexgo-demo"),
); err != nil {
return errors.New[errors.Internal](&errors.Bubble{
What: "Failure to set ENV",
Who: err,
})
}
return nil
}