routes.js 783 Bytes
Newer Older
1
// # Global Routes
KangMin An's avatar
KangMin An committed
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";
KangMin An's avatar
KangMin An committed
18
const CONFIRM = "/confirm";
19
20
21
22
const EDIT_PROFILE = "/edit-profile";

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

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

export default routes;