Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Commit

Permalink
Use value from .env file for API_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
FaZeRs committed Jun 4, 2019
1 parent 14e7621 commit 5b31185
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost:8000
MIX_API_URL=http://localhost:8000/api
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_TIMEZONE=UTC
Expand Down Expand Up @@ -37,4 +38,4 @@ MAIL_USERNAME=testuser
MAIL_PASSWORD=testpwd
MAIL_ENCRYPTION=null

BUGSNAG_API_KEY=
BUGSNAG_API_KEY=
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
MIX_API_URL=http://localhost/api
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_TIMEZONE=UTC
Expand Down
7 changes: 6 additions & 1 deletion resources/js/common/api.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,14 @@ export const SettingsService = {
}
}


export const ContactService = {
send(data) {
return ApiService.post('contact/send', data);
},
}

export const LanguageService = {
swap(locale) {
return ApiService.get('lang', locale);
},
}
2 changes: 1 addition & 1 deletion resources/js/common/config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const API_URL = 'http://localhost:8000/api'
export const API_URL = process.env.MIX_API_URL
export default API_URL

0 comments on commit 5b31185

Please sign in to comment.