diff --git a/src/api/StorageLogsAPI.js b/src/api/StorageLogsAPI.js new file mode 100644 index 0000000..3b0d702 --- /dev/null +++ b/src/api/StorageLogsAPI.js @@ -0,0 +1,15 @@ +import axios from 'axios'; +import {API_URL, ENDPOINTS} from './consts'; + +class StorageLogsApi { + URL = `${API_URL}${ENDPOINTS.SERVER_LOGS}`; + + request = async () => { + const {data} = await axios.get(this.URL); + return data; + } +} + +const storageLogsApi = new StorageLogsApi(); + +export default storageLogsApi; diff --git a/src/api/StorageServiceAPI.js b/src/api/StorageServiceAPI.js index bac842d..8958885 100644 --- a/src/api/StorageServiceAPI.js +++ b/src/api/StorageServiceAPI.js @@ -1,6 +1,6 @@ import axios from 'axios'; -import {API_URL, ENDPOINT, TESTING_HEADERS} from './consts'; +import {API_URL, ENDPOINTS, TESTING_HEADERS} from './consts'; /** * @interface Store @@ -17,7 +17,7 @@ import {API_URL, ENDPOINT, TESTING_HEADERS} from './consts'; * @class */ class StorageServiceApi { - URL = `${API_URL}${ENDPOINT}`; + URL = `${API_URL}${ENDPOINTS.STORE}`; get defaultConfig () { if (location.hostname.includes('localhost')) { diff --git a/src/api/consts.js b/src/api/consts.js index 9a32147..7f23508 100644 --- a/src/api/consts.js +++ b/src/api/consts.js @@ -1,7 +1,11 @@ export const API_URL = 'http://api.storage.vigdorov.ru'; -export const ENDPOINT = '/store'; +export const ENDPOINTS = { + STORE: '/store', + CLIENT_LOGS: '/logs/client', + SERVER_LOGS: '/logs/server', +}; export const TESTING_HEADERS = { 'Api-Name': 'store-service-test', diff --git a/src/app.html b/src/app.html index 02eec38..ca7f3ce 100644 --- a/src/app.html +++ b/src/app.html @@ -66,6 +66,51 @@ + + + + + + + + + + + + +