Skip to content

Commit

Permalink
Add ingress domain, so that I can then fix CORS issue with react fron…
Browse files Browse the repository at this point in the history
…tend accessing API being hardcoded to localhost (#15)

* Add ingress domain, so that I can then fix CORS issue with react frontend accessing API being hardcoded to localhost

* Use ingressdomain
  • Loading branch information
CalvinAllen authored Oct 28, 2024
1 parent 45a054e commit 8eca986
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/api/ownerReducers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Owner } from 'src/types/owner';

export const ownersApi = createApi({
baseQuery: fetchBaseQuery({
baseUrl: 'http://localhost:8081/rest',
baseUrl: 'http://petclinic-demogorgon.staging-service.nr-ops.net:8081/rest',
prepareHeaders: (headers) => {
headers.set('Content-Type', 'application/json');
return headers;
Expand Down
21 changes: 21 additions & 0 deletions grandcentral/ingressdomains.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
version: gc/alpha1
kind: IngressDomain
spec:
domain: petclinic-demogorgon.staging-service.nr-ops.net
visibility: internal
target_environment: staging
routes:
- priority: 100
config:
matchOn:
path:
prefix: "/"
options:
timeout: 10s
cors:
enabled: true
csrf:
enabled: true
auth:
type: unauthenticated

0 comments on commit 8eca986

Please sign in to comment.