Gives every request of the frontend its base URL, and the feeds their page sizes.

In development, Vite serves the frontend on its own port, so the URLs are absolute, and VITE_API_* variables can point elsewhere. In production the API server serves the frontend, so the URLs are relative and the same build works on any domain.

Variables

v
API_URL: string

The API's origin, which every fetch of the frontend prefixes to its path. It is empty in production, where the API is the page's own origin.

v
COMMUNITY_FEED_URL: string

The community feed's endpoint, for CommunityFeedProvider.

v
COMMUNITY_URL: string

The community endpoint, for the community page.

v
DEFAULT_PAGE_SIZE: 20

How many items a page of a feed or list asks the API for.

v
NOTIFICATIONS_PAGE_SIZE: 30

How many notifications a page of /notifications asks the API for.

v
SEARCH_URL: string

The search endpoint, for the search page.

v
WS_URL: string

The socket's origin, for WSProvider. It is always absolute, since WebSocket takes no relative URL.