Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/src/scripts/net/netconfig.js

    rd565449 r0c6b92a  
     1export const API_BASE_URL = "http://localhost:8080/api";
     2export const API_PROTECTED = `${API_BASE_URL}/protected`
     3export const API_PUBLIC = `${API_BASE_URL}/public`
     4export const API_AUTH = `${API_BASE_URL}/auth`
     5
    16
    27const config = {
    3     apiBaseUrl: "http://localhost:8080/api",
     8    my_maps: {
     9        display: `${API_PROTECTED}/my-maps`,
     10        save: `${API_PROTECTED}/my-maps/save`,
     11        add: `${API_PROTECTED}/my-maps/create`,
     12        load: `${API_PROTECTED}/my-maps/load`,
     13        delete: `${API_PROTECTED}/my-maps/delete`,
     14        publish: `${API_PROTECTED}/publish/add`,
     15        publish_get: `${API_PROTECTED}/publish/get`,
     16    },
     17    room_types: {
     18        display: (auth) => {
     19            return auth ? `${API_PROTECTED}/room-types` : `${API_PUBLIC}/room-types`
     20        },
     21        add: `${API_PROTECTED}/room-types/add`,
    422
    5     endpoints: {
    6         login: "/auth/login",
    7         register: "/auth/register",
    8         verify: "/auth/verify",
    9         render: "/protected/render",
    10         publicMapData: "/public/mapData"
     23    },
     24    floors: {
     25        add: `${API_PROTECTED}/floors/add`,
     26        load: `${API_PROTECTED}/my-maps/load`,
     27        delete: `${API_PROTECTED}/floors/delete`,
     28    },
     29    view_maps: {
     30        display: `${API_PUBLIC}/maps`,
     31        load: (auth) => {
     32            return auth ? `${API_PROTECTED}/load-map` : `${API_PUBLIC}/load-map`
     33        },
     34        navigate: `${API_PUBLIC}/navigate`,
     35        add_favourite: `${API_PROTECTED}/favourites/add`,
     36    },
     37    favourites: {
     38        display: `${API_PROTECTED}/favourites`,
     39        add: `${API_PROTECTED}/favourites/add`,
     40        delete: `${API_PROTECTED}/favourites/delete`,
     41    },
     42    auth:{
     43        login: `${API_AUTH}/login`,
     44        register: `${API_AUTH}/register`,
     45        verify: `${API_AUTH}/verify`
     46
     47    },
     48    admin:{
     49        display: `${API_BASE_URL}/admin`,
     50        load_pr: `${API_BASE_URL}/admin/load-pr`,
     51        approve_pr: `${API_BASE_URL}/admin/pr/approve`,
     52        deny_pr: `${API_BASE_URL}/admin/pr/deny`
    1153    }
    1254};
    1355
     56
    1457export default config;
Note: See TracChangeset for help on using the changeset viewer.