Browse Source

🔧 Add configuration file

master
KaKi87 4 months ago
parent
commit
ca501331dc
  1. 3
      .gitignore
  2. 5
      config.example.js
  3. 7
      src/components/App.vue
  4. 3
      src/components/AppFooter.vue
  5. 5
      src/components/AppHeader.vue

3
.gitignore vendored

@ -1,4 +1,5 @@
.idea
.parcel-cache
dist
node_modules
node_modules
config.js

5
config.example.js

@ -0,0 +1,5 @@
/**
* API URL
* @type {String}
*/
export const apiUrl = null;

7
src/components/App.vue

@ -5,11 +5,13 @@
import playSearch from '@playsearch.kaki87.net/v2-client';
import { apiUrl } from '../../config.js';
import AppHeader from './AppHeader.vue';
import AppMain from './AppMain.vue';
import AppFooter from './AppFooter.vue';
const client = playSearch({ host: 'https://playsearch-v2-api.kaki87.net' });
const client = playSearch({ host: apiUrl });
export default {
components: {
@ -24,6 +26,7 @@
filters: undefined
}),
computed: {
apiUrl: () => apiUrl,
filteredItems: function(){
if(!this.filters) return this.items;
const {
@ -121,6 +124,7 @@
<template class="App">
<AppHeader
:api-url="apiUrl"
:is-loading="isLoading"
@submit-search="search"
></AppHeader>
@ -130,6 +134,7 @@
:total-item-count="items.length"
></AppMain>
<AppFooter
:api-url="apiUrl"
:filter-data="filterData"
@update-filters="_filters => $data.filters = _filters"
></AppFooter>

3
src/components/AppFooter.vue

@ -1,6 +1,7 @@
<script>
export default {
props: {
apiUrl: undefined,
filterData: undefined
},
'data': () => ({
@ -136,7 +137,7 @@
<p
style="margin: 0"
><a
href="https://playsearch-v2-api.kaki87.net/link/x3Free"
:href="`${apiUrl}/link/x3Free`"
target="_blank"
>Best of free, ad-free, in-app free apps</a></p>
</footer>

5
src/components/AppHeader.vue

@ -1,6 +1,7 @@
<script>
export default {
props: {
apiUrl: undefined,
isLoading: undefined
},
'data': () => ({
@ -47,12 +48,12 @@
</form>
<ul class="App__Header__Links" style="margin: 0; padding: 0">
<li class="App__Header__Links__Item"><a
href="https://playsearch-v2-api.kaki87.net/link/about"
:href="`${apiUrl}/link/about`"
target="_blank"
data-uk-tooltip="title: README.md; pos: bottom"
>About</a></li>
<li class="App__Header__Links__Item"><a
href="https://playsearch-v2-api.kaki87.net/link/support"
:href="`${apiUrl}/link/support`"
target="_blank"
data-uk-tooltip="title: On Discord; pos: bottom"
>Get support</a></li>

Loading…
Cancel
Save