routes.js 917 Bytes
Newer Older
1
// # Global Routes
2
const BASE = "/api";
KangMin An's avatar
KangMin An committed
3

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

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

// # Auth
16
const SIGNUP = "/signup";
17
const LOGIN = "/login";
18
const CONFIRM = "/confirm";
19
20
21

// # User Info
const USER_INFO = "/user-info";
KangMin An's avatar
KangMin An committed
22
const SET_LOCCODE = "/set-loccode";
23
const EDIT_PROFILE = "/edit-profile";
24
25
26

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

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

export default routes;