feat(web)!: remove web.Config.AllowedOrigins; CORS lives only on server.Config.CORSOrigins (v1.3.0)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# einherjar/web
|
||||
|
||||
[](https://code.nochebuena.dev/einherjar/web)
|
||||
[](https://code.nochebuena.dev/einherjar/web)
|
||||
[](LICENSE)
|
||||
[](https://go.dev)
|
||||
|
||||
@@ -57,12 +57,16 @@ lc.BeforeStart(func() error {
|
||||
lc.Run()
|
||||
```
|
||||
|
||||
With origins (CORS auto-applied):
|
||||
With origins set in code (CORS auto-applied). `Server.CORSOrigins` is the single
|
||||
source of truth — normally it loads from `EINHERJAR_SERVER_CORS_ORIGINS`, but you
|
||||
can set it directly to override without the env var:
|
||||
|
||||
```go
|
||||
srv := web.New(logger, web.Config{
|
||||
Server: server.Config{Port: 9090},
|
||||
AllowedOrigins: []string{"https://example.com"},
|
||||
Server: server.Config{
|
||||
Port: 9090,
|
||||
CORSOrigins: []string{"https://example.com"},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user