Skip to content

Commit

Permalink
Add APP_HOST env for origin header
Browse files Browse the repository at this point in the history
  • Loading branch information
alexookah committed Dec 29, 2024
1 parent 02a1c37 commit fdb359c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
GQL_HOST="https://example.com/graphql"
# If you have the WooNuxt-Settings plugin installed this is all you need. Everything else is optional and can be configured in the WordPress admin under Settings > WooNuxt.

# url of the app (optional, defaults to http://localhost:3000)
APP_HOST="http://localhost:3000"

# If you don't have the plugin installed, you can configure the rest of the settings here.

Expand Down
1 change: 1 addition & 0 deletions woonuxt_base/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default defineNuxtConfig({
default: {
host: process.env.GQL_HOST || 'http://localhost:4000/graphql',
corsOptions: { mode: 'cors', credentials: 'include' },
headers: { 'Origin': process.env.APP_HOST || 'http://localhost:3000' },
},
},
},
Expand Down

0 comments on commit fdb359c

Please sign in to comment.