This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
axios.get('/user/4567') | |
.then(function (response) { | |
// right ? | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
axios.get(baseURL + '/user/' + userId) | |
.then(function (response) { | |
// better | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ApiBaseUrl = process.env.API_URL | |
const BasePrefix = '/api' | |
const Base = ApiBaseUrl + BasePrefix + '/v1' | |
const NodesBase = Base + '/nodes' | |
const ApiRoutes = { | |
ApiBaseUrl: ApiBaseUrl, | |
Nodes: { | |
GetAll: NodesBase, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const response = await axios.get(ApiRoutes.Nodes.GetDetailsById(1234)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AppRoutes = { | |
Home: { | |
path: '/', | |
name: 'Home', | |
component: Home | |
}, | |
NodeDetails: { | |
path: '/nodes/:nodeId', | |
name: 'Node Details', | |
component: NodeInfoPage, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
import ApiRoutes from '@/api/ApiRoutes' | |
const state = { | |
nodeList: [], | |
} | |
const getters = {} | |
const actions = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<!-- ... --> | |
<h2 class="row">Online Nodes</h2> | |
<div class="row"> | |
<p v-if="error == '' && !loading && nodes.length == 0">No nodes found</p> | |
<div v-if="!loading && processedNodes.length > 0" class="table-responsive"> |