mirror of
https://github.com/catdevnull/preciazo.git
synced 2025-02-19 23:06: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-wal
|
||||
target/
|
||||
.env.*
|
||||
*.local
|
||||
|
||||
|
||||
.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
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
*.local
|
||||
!.env.example
|
||||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
||||
|
|
|
@ -2,7 +2,9 @@ import type { PageServerLoad } from "./$types";
|
|||
import z from "zod";
|
||||
|
||||
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();
|
||||
return z
|
||||
.array(
|
||||
|
|
Loading…
Reference in a new issue