Skip to content

Commit

Permalink
🚑 PB Connection URL hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ThijmenGThN committed Dec 16, 2023
1 parent 64dbb43 commit a2b3491
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/[locale]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default async function Page() {
categories.map(category => (
<li key={category.id}>
<Link className="flex flex-col gap-y-2 rounded bg-gradient-to-tr from-gray-50 to-white border p-4 shadow-sm hover:cursor-pointer hover:to-gray-100"
href={category.slug}
href={category.slug ?? '/'}
>
<p>
{category.name}
Expand Down
9 changes: 6 additions & 3 deletions src/helpers/pocketbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import Pocketbase from 'pocketbase'

var pb: Pocketbase

// -- Internal
if (typeof window === 'undefined') pb = new Pocketbase('http://127.0.0.1:' + process.env.POCKETBASE_PORT)
// -- Server
if (typeof window === 'undefined') {
if (process.env.COMPOSE_PROFILES?.toLocaleLowerCase() != 'prod') pb = new Pocketbase('http://0.0.0.0:8090')
else pb = new Pocketbase('http://pocketbase:' + process.env.POCKETBASE_PORT)
}

// -- Remote
// -- Client
else {
pb = new Pocketbase(process.env.NEXT_PUBLIC_POCKETBASE_URL)

Expand Down

0 comments on commit a2b3491

Please sign in to comment.