api url from config
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getNavigationsValue } from '@ijl/cli';
|
||||
import { getNavigationsValue, getConfigValue } from '@ijl/cli';
|
||||
import { generatePath } from 'react-router-dom';
|
||||
|
||||
const baseUrl = getNavigationsValue('r-and-m.main');
|
||||
@@ -13,5 +13,7 @@ export const URLs = {
|
||||
getUrl: (charId: number) => generatePath(`${baseUrl}${getNavigationsValue('r-and-m.character.detail')}`, { charId })
|
||||
}
|
||||
},
|
||||
api: {},
|
||||
api: {
|
||||
main: getConfigValue('r-and-m.api')
|
||||
},
|
||||
}
|
||||
|
||||
@@ -14,4 +14,6 @@ const App = () => {
|
||||
);
|
||||
};
|
||||
|
||||
App.displayName = "App-22";
|
||||
|
||||
export default App;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Link } from "../link";
|
||||
import { Nav, NavList } from "./nav-panel.style";
|
||||
import { URLs } from "../../__data__/urls";
|
||||
|
||||
const navList = [
|
||||
const _navList = [
|
||||
{ title: "Home", href: "/r-and-m" },
|
||||
{ title: "Персонажи", href: "/r-and-m/search" },
|
||||
{ title: "Локации", href: "#03" },
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// @es-lint-ignore-file
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Link } from "../components/link";
|
||||
import { Card } from "../components/card";
|
||||
import { Header1 } from "../components/common";
|
||||
import { ErrorBoundary } from "../components/error-boundary";
|
||||
import { Button } from "../components/button";
|
||||
import { URLs } from "../__data__/urls";
|
||||
|
||||
import {
|
||||
BrandText,
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
export const LandingPage = () => {
|
||||
const [data, setData] = useState([])
|
||||
useEffect(() => {
|
||||
fetch('/api/landing-data')
|
||||
fetch(`${URLs.api.main}/landing-data`)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
setData(data.data)
|
||||
|
||||
Reference in New Issue
Block a user