source: frontend/src/lib/api.ts@ b8093a0

Last change on this file since b8093a0 was b8093a0, checked in by imbrsk <boris696boris@…>, 3 days ago

Merge iknow-remaster into frontend/

Bring the Next.js frontend into this repository as a monorepo subdirectory,
preserving its full commit history via a subtree merge.

  • Property mode set to 100644
File size: 604 bytes
Line 
1/**
2 * Base URL of the iknow-api backend.
3 *
4 * Set NEXT_PUBLIC_API_BASE_URL in .env.local to point at a local API run
5 * (see .env.example). The faculty database is only reachable through the SSH
6 * tunnel on the developer machine, so the deployed backend cannot read it -
7 * working against real data means running iknow-api locally.
8 */
9export const API_BASE_URL =
10 process.env.NEXT_PUBLIC_API_BASE_URL ?? 'https://iknow-api.onrender.com';
11
12/** Builds an absolute API URL from a path such as `/api/user/getUser`. */
13export function apiUrl(path: string): string {
14 return `${API_BASE_URL}${path}`;
15}
Note: See TracBrowser for help on using the repository browser.