routes.js 735 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
18
19
20
21
const LOGIN = "/login";
const EDIT_PROFILE = "/edit-profile";

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

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

export default routes;