mirror of
https://github.com/catdevnull/preciazo.git
synced 2025-02-21 11:36:26 +00:00
fix: usar env para API HOST
This commit is contained in:
parent
8d9fce5293
commit
4bf1351688
5 changed files with 8 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,7 +3,7 @@ node_modules/
|
||||||
*.db-shm
|
*.db-shm
|
||||||
*.db-wal
|
*.db-wal
|
||||||
target/
|
target/
|
||||||
.env.*
|
*.local
|
||||||
|
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
1
db-datos/.env.development
Normal file
1
db-datos/.env.development
Normal file
|
@ -0,0 +1 @@
|
||||||
|
DB_PATH=../sqlite.db
|
2
sitio/.env.development
Normal file
2
sitio/.env.development
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
DB_PATH=../sqlite.db
|
||||||
|
VITE_API_HOST=http://localhost:8000
|
2
sitio/.gitignore
vendored
2
sitio/.gitignore
vendored
|
@ -4,7 +4,7 @@ node_modules
|
||||||
/.svelte-kit
|
/.svelte-kit
|
||||||
/package
|
/package
|
||||||
.env
|
.env
|
||||||
.env.*
|
*.local
|
||||||
!.env.example
|
!.env.example
|
||||||
vite.config.js.timestamp-*
|
vite.config.js.timestamp-*
|
||||||
vite.config.ts.timestamp-*
|
vite.config.ts.timestamp-*
|
||||||
|
|
|
@ -2,7 +2,9 @@ import type { PageServerLoad } from "./$types";
|
||||||
import z from "zod";
|
import z from "zod";
|
||||||
|
|
||||||
async function getBestSelling() {
|
async function getBestSelling() {
|
||||||
const res = await fetch("http://localhost:8000/api/0/best-selling-products");
|
const res = await fetch(
|
||||||
|
`${import.meta.env.VITE_API_HOST}/api/0/best-selling-products`,
|
||||||
|
);
|
||||||
const json = await res.json();
|
const json = await res.json();
|
||||||
return z
|
return z
|
||||||
.array(
|
.array(
|
||||||
|
|
Loading…
Reference in a new issue