środowisko dev

This commit is contained in:
2023-07-04 23:44:06 +02:00
parent 79d5413638
commit 5ba9e95547
3 changed files with 11 additions and 8 deletions
+3
View File
@@ -23,3 +23,6 @@ pnpm-debug.log*
*.sln *.sln
*.sw? *.sw?
node_modules node_modules
# Dev files
stockInfoDev.json
+7 -7
View File
@@ -73,13 +73,13 @@ export default defineComponent({
}), }),
async created() { async created() {
const stockData = await ( if (import.meta.env['VITE_STOCK_DEV'] == '1') {
await fetch( const data = await import('../stockInfoDev.json');
`https://spythere.github.io/api/td2/data/stockInfo${import.meta.env['VITE_STOCK_DEV'] == '1' ? 'Dev' : ''}.json` this.store.stockData = data.default as any;
) } else {
).json(); const stockData = await (await fetch(`https://spythere.github.io/api/td2/data/stockInfo.json`)).json();
this.store.stockData = stockData;
this.store.stockData = stockData; }
// routing // routing
switch (window.location.pathname) { switch (window.location.pathname) {
+1 -1
View File
@@ -42,7 +42,7 @@ export interface IStockProps {
export interface IStockData { export interface IStockData {
generator: { generator: {
passenger: []; passenger: any;
cargo: { cargo: {
[key: string]: string[]; [key: string]: string[];
}; };