[0c6b92a] | 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 |
|
---|
[d565449] | 6 |
|
---|
| 7 | const config = {
|
---|
[0c6b92a] | 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`,
|
---|
[79a0317] | 16 | edit_map_info: `${API_PROTECTED}/my-maps/edit`,
|
---|
[0c6b92a] | 17 | },
|
---|
| 18 | room_types: {
|
---|
| 19 | display: (auth) => {
|
---|
| 20 | return auth ? `${API_PROTECTED}/room-types` : `${API_PUBLIC}/room-types`
|
---|
| 21 | },
|
---|
| 22 | add: `${API_PROTECTED}/room-types/add`,
|
---|
| 23 |
|
---|
| 24 | },
|
---|
| 25 | floors: {
|
---|
| 26 | add: `${API_PROTECTED}/floors/add`,
|
---|
| 27 | load: `${API_PROTECTED}/my-maps/load`,
|
---|
| 28 | delete: `${API_PROTECTED}/floors/delete`,
|
---|
| 29 | },
|
---|
| 30 | view_maps: {
|
---|
| 31 | display: `${API_PUBLIC}/maps`,
|
---|
| 32 | load: (auth) => {
|
---|
| 33 | return auth ? `${API_PROTECTED}/load-map` : `${API_PUBLIC}/load-map`
|
---|
| 34 | },
|
---|
| 35 | navigate: `${API_PUBLIC}/navigate`,
|
---|
| 36 | add_favourite: `${API_PROTECTED}/favourites/add`,
|
---|
[79a0317] | 37 | add_report: `${API_PROTECTED}/reports/create`,
|
---|
[0c6b92a] | 38 | },
|
---|
| 39 | favourites: {
|
---|
| 40 | display: `${API_PROTECTED}/favourites`,
|
---|
| 41 | add: `${API_PROTECTED}/favourites/add`,
|
---|
| 42 | delete: `${API_PROTECTED}/favourites/delete`,
|
---|
| 43 | },
|
---|
| 44 | auth:{
|
---|
| 45 | login: `${API_AUTH}/login`,
|
---|
| 46 | register: `${API_AUTH}/register`,
|
---|
[79a0317] | 47 | verify: `${API_AUTH}/verify`,
|
---|
| 48 | oauth: {
|
---|
| 49 | github: {
|
---|
| 50 | state: `${API_BASE_URL}/oauth/state`,
|
---|
| 51 | redirectUri : `${API_BASE_URL}/oauth/callback`
|
---|
| 52 | }
|
---|
| 53 | }
|
---|
[0c6b92a] | 54 |
|
---|
| 55 | },
|
---|
| 56 | admin:{
|
---|
| 57 | display: `${API_BASE_URL}/admin`,
|
---|
| 58 | load_pr: `${API_BASE_URL}/admin/load-pr`,
|
---|
| 59 | approve_pr: `${API_BASE_URL}/admin/pr/approve`,
|
---|
[79a0317] | 60 | deny_pr: `${API_BASE_URL}/admin/pr/deny`,
|
---|
| 61 | load_reports: `${API_BASE_URL}/admin/load-reports`
|
---|
[d565449] | 62 | }
|
---|
| 63 | };
|
---|
| 64 |
|
---|
[0c6b92a] | 65 |
|
---|
[d565449] | 66 | export default config;
|
---|