source: src/lib/api.ts@ 8496f3c

Last change on this file since 8496f3c was 8496f3c, checked in by Stefan-Saveski <stefansaveski19@…>, 8 days ago
  • ready for presentation
  • 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.