routes.js 846 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
const EDIT_PROFILE = "/edit-profile";
KangMin An's avatar
KangMin An committed
20
const SET_LOCCODE = "/set-loccode";
21
22
23

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

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

export default routes;