Add BASE_URL constant to page and have AJAX calls use it

This commit is contained in:
Nabeel Shahzad
2018-01-02 10:59:44 -06:00
parent 2325573c50
commit cb772a3c62
5 changed files with 18 additions and 14 deletions

View File

@@ -1,5 +1,16 @@
@section('scripts')
<script>
function phpvms_vacentral_airport_lookup(icao, callback) {
$.ajax({
url: BASE_URL + '/api/airports/'+ icao + '/lookup',
method: 'GET',
headers: {
'x-api-key': PHPVMS_USER_API_KEY
}
}).done(function (data, status) {
callback(data.data);
});
}
$(document).ready(function() {