routes.js 1.02 KB
Newer Older
1
2
import envs from "../config/config";

3
// # Global Routes
4
const BASE = envs.production ? "/app/eue/api" : "/api";
KangMin An's avatar
KangMin An committed
5

6
// # Data Routes
7
const DATA = "/data";
8
// Data - Collector
9
const DATA_INPUT = "/input";
10
11
12
13
14
15
16
17
// Data - Consumer
const DATA_USER = "/user";
const DATA_OUTSIDE = "/outside";

// # Local Code Data
const LOCCODE = "/loccode";

// # Auth
18
const SIGNUP = "/signup";
19
const LOGIN = "/login";
20
const LOGOUT = "/logout";
21
const CONFIRM = "/confirm";
22
23
24

// # User Info
const USER_INFO = "/user-info";
25
const TOGGLE_AIRCON = "/toggle-aircon";
26
const EDIT_PROFILE = "/edit-profile";
27
28
29

// # Detail Object
const DETAIL = "/:id";
30

KangMin An's avatar
KangMin An committed
31
const routes = {
32
  base: BASE,
33
34
  data: DATA,
  dataInput: DATA_INPUT,
35
36
37
  dataUser: DATA_USER,
  dataOutside: DATA_OUTSIDE,
  locCode: LOCCODE,
38
  signup: SIGNUP,
39
  login: LOGIN,
40
  logout: LOGOUT,
41
  confirm: CONFIRM,
42
  userinfo: USER_INFO,
43
  editProfile: EDIT_PROFILE,
44
  toggleAircon: TOGGLE_AIRCON,
45
46
47
48
49
50
51
  Detail: (id) => {
    if (id) {
      return `/${id}`;
    } else {
      return DETAIL;
    }
  },
KangMin An's avatar
KangMin An committed
52
53
54
};

export default routes;