mirror of
https://github.com/rybbit-io/rybbit.git
synced 2025-05-10 20:05:38 +02:00
use next public
This commit is contained in:
parent
e58671d2f8
commit
c633346756
4 changed files with 6 additions and 6 deletions
|
@ -2,7 +2,7 @@
|
|||
const nextConfig = {
|
||||
output: "standalone",
|
||||
env: {
|
||||
BACKEND_URL: process.env.BACKEND_URL,
|
||||
NEXT_PUBLIC_BACKEND_URL: process.env.NEXT_PUBLIC_BACKEND_URL,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ export function Header() {
|
|||
const { data } = useQuery<{ count: number }>({
|
||||
queryKey: ["active-sessions"],
|
||||
queryFn: () =>
|
||||
fetch(`${process.env.BACKEND_URL}/live-user-count`).then((res) =>
|
||||
res.json()
|
||||
fetch(`${process.env.NEXT_PUBLIC_BACKEND_URL}/live-user-count`).then(
|
||||
(res) => res.json()
|
||||
),
|
||||
});
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ export function useGenericQuery<T>(
|
|||
queryFn: () => {
|
||||
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
return fetch(
|
||||
`${process.env.BACKEND_URL}/${endpoint}?startDate=${startDate}&endDate=${endDate}&timezone=${timezone}`
|
||||
`${process.env.NEXT_PUBLIC_BACKEND_URL}/${endpoint}?startDate=${startDate}&endDate=${endDate}&timezone=${timezone}`
|
||||
).then((res) => res.json());
|
||||
},
|
||||
staleTime: Infinity,
|
||||
|
@ -106,7 +106,7 @@ export function useGetPageviews(): UseQueryResult<
|
|||
queryFn: () => {
|
||||
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
return fetch(
|
||||
`${process.env.BACKEND_URL}/pageviews?startDate=${startDate}&endDate=${endDate}&timezone=${timezone}&bucket=${bucket}`
|
||||
`${process.env.NEXT_PUBLIC_BACKEND_URL}/pageviews?startDate=${startDate}&endDate=${endDate}&timezone=${timezone}&bucket=${bucket}`
|
||||
).then((res) => res.json());
|
||||
},
|
||||
placeholderData: keepPreviousData,
|
||||
|
|
|
@ -59,7 +59,7 @@ services:
|
|||
- NODE_ENV=production
|
||||
- CLICKHOUSE_HOST=http://clickhouse:8123
|
||||
- CLICKHOUSE_DB=analytics
|
||||
- BACKEND_URL=${BASE_URL}
|
||||
- NEXT_PUBLIC_BACKEND_URL=${BASE_URL}
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue