Skip to content

Commit

Permalink
update readme, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikmonsen committed Sep 13, 2024
1 parent ca93af8 commit 09873c7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NEXT_PUBLIC_BASE_PATH=/hugin
CATALOGUE_API_PATH=http://localhost:8087/bikube
DATABASE_URL=''
AUTH_API=http://localhost:8088/auth
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ For å kjøre lokalt må du sette de nødvendige miljøvariablene:
cp .env.example .env.local
```

| Variabelnavn | Standardverdi | Beskrivelse |
|------------------------------|------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| NEXT_PUBLIC_BASE_PATH | /hugin | Base path for applikasjonen |
| CATALOGUE_API_PATH | http://localhost:8087/bikube | Sti til [katalog APIet ](https://github.com/NationalLibraryOfNorway/bikube)<br/>Må starte med `http://` eller `https://` |
| DATABASE_URL | | URL til databasen (se mer info i eget avsnitt under) |
| KEYCLOAK_TEKST_URL | | Url til keycloak-tekst (inkl. realm om open-idconnect, eks. https://mysite.com/authn/realms/myRealm/protocol/openid-connect |
| KEYCLOAK_TEKST_CLIENT_ID | | Client ID i keycloak-tekst |
| KEYCLOAK_TEKST_CLIENT_SECRET | | Client secret i keycloak-tekst |
| Variabelnavn | Standardverdi | Beskrivelse |
|------------------------------|----------------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| NEXT_PUBLIC_BASE_PATH | /hugin | Base path for applikasjonen |
| CATALOGUE_API_PATH | http://localhost:8087/bikube | Sti til [katalog APIet ](https://github.com/NationalLibraryOfNorway/bikube)<br/>Må starte med `http://` eller `https://` |
| AUTH_API_PATH | http://localhost:8080/tekst-auth | Sti til [autentiserings APIet](https://github.com/NationalLibraryOfNorway/tekst-auth)<br/>Må starte med `http://` eller `https://` |
| DATABASE_URL | | URL til databasen (se mer info i eget avsnitt under) |
| KEYCLOAK_TEKST_URL | | Url til keycloak-tekst (inkl. realm om open-idconnect, eks. https://mysite.com/authn/realms/myRealm/protocol/openid-connect |
| KEYCLOAK_TEKST_CLIENT_ID | | Client ID i keycloak-tekst |
| KEYCLOAK_TEKST_CLIENT_SECRET | | Client secret i keycloak-tekst |

Deretter må du kjøre følgende kommandoer:
```bash
Expand Down
1 change: 0 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {withSentryConfig} from "@sentry/nextjs";
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
output: "standalone",
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
async rewrites() {
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/auth/refresh/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function POST(req: NextRequest) {
return NextResponse.json({error: 'No user token found'}, {status: 401});
}

const data = await fetch(`${process.env.AUTH_API}/refresh`, {
const data = await fetch(`${process.env.AUTH_API_PATH}/refresh`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/auth/signin/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface LoginRequest {

export async function POST(req: NextRequest) {
const {code, redirectUrl} = await req.json() as LoginRequest;
const data = await fetch(`${process.env.AUTH_API}/login?${redirectUrl}`, {
const data = await fetch(`${process.env.AUTH_API_PATH}/login?${redirectUrl}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/auth/signout/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function POST(req: NextRequest) {
return NextResponse.json({error: 'No user token found'}, {status: 401});
}

return await fetch(`${process.env.AUTH_API}/logout`, {
return await fetch(`${process.env.AUTH_API_PATH}/logout`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
Expand Down

0 comments on commit 09873c7

Please sign in to comment.