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 |
|
---|
6 |
|
---|
7 | const config = {
|
---|
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`,
|
---|
22 |
|
---|
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`
|
---|
53 | }
|
---|
54 | };
|
---|
55 |
|
---|
56 |
|
---|
57 | export default config;
|
---|