Skip to content

Commit

Permalink
feat(scan): SERVER_URL env
Browse files Browse the repository at this point in the history
  • Loading branch information
popstas committed Dec 17, 2020
1 parent 47185fb commit 60ea490
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ module.exports = {
},

env: {
itemsJsonUrl: process.env.JSON_URL || 'http://localhost:3001/data.json'
itemsJsonUrl: process.env.JSON_URL || 'http://localhost:3001/data.json',
SERVER_URL: process.env.SERVER_URL
},

io: {
sockets: [{
name: 'main',
url: 'http://localhost:3001'
url: process.env.SERVER_URL || 'http://localhost:3001'
}]
},

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://github.com/viasite/site-audit-seo-viewer",
"private": true,
"scripts": {
"dev": "cross-env HOST=0.0.0.0 PORT=3000 nuxt",
"dev": "cross-env SERVER_URL=http://localhost:3001 HOST=0.0.0.0 PORT=3000 nuxt",
"build": "nuxt build",
"deploy": "bash scripts/deploy.sh",
"deploy-dev": "bash data/deploy-dev.sh",
Expand Down
2 changes: 1 addition & 1 deletion pages/scan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</style>

<script>
const apiUrl = 'http://localhost:3001';
const apiUrl = process.env.SERVER_URL || 'http://localhost:3001';
export default {
components: {},
Expand Down

0 comments on commit 60ea490

Please sign in to comment.