Changeset 0c6b92a for imaps-frontend/src/scripts/net/netconfig.js
- Timestamp:
- 12/12/24 17:06:06 (5 weeks ago)
- Branches:
- main
- Parents:
- d565449
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/src/scripts/net/netconfig.js
rd565449 r0c6b92a 1 export const API_BASE_URL = "http://localhost:8080/api"; 2 export const API_PROTECTED = `${API_BASE_URL}/protected` 3 export const API_PUBLIC = `${API_BASE_URL}/public` 4 export const API_AUTH = `${API_BASE_URL}/auth` 5 1 6 2 7 const 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`, 4 22 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` 11 53 } 12 54 }; 13 55 56 14 57 export default config;
Note:
See TracChangeset
for help on using the changeset viewer.