/
routes.js
79 lines (66 loc) · 2.27 KB
/
routes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* Copyright (C) 2015 Ben Ockmore
* 2015 Sean Burke
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
import authRouter from './routes/auth';
import creatorRouter from './routes/entity/creator';
import editionRouter from './routes/entity/edition';
import editorRouter from './routes/editor';
import indexRouter from './routes/index';
import publicationRouter from './routes/entity/publication';
import publisherRouter from './routes/entity/publisher';
import registerRouter from './routes/register';
import revisionRouter from './routes/revision';
import searchRouter from './routes/search';
import statisticsRouter from './routes/statistics';
import workRouter from './routes/entity/work';
function initRootRoutes(app) {
app.use('/', indexRouter);
app.use('/', authRouter);
app.use('/search', searchRouter);
app.use('/register', registerRouter);
app.use('/statistics', statisticsRouter);
}
function initPublicationRoutes(app) {
app.use('/publication', publicationRouter);
}
function initCreatorRoutes(app) {
app.use('/creator', creatorRouter);
}
function initEditionRoutes(app) {
app.use('/edition', editionRouter);
}
function initWorkRoutes(app) {
app.use('/work', workRouter);
}
function initPublisherRoutes(app) {
app.use('/publisher', publisherRouter);
}
function initRevisionRoutes(app) {
app.use('/revision', revisionRouter);
}
function initRoutes(app) {
initRootRoutes(app);
initPublicationRoutes(app);
initCreatorRoutes(app);
initEditionRoutes(app);
initWorkRoutes(app);
initPublisherRoutes(app);
initRevisionRoutes(app);
app.use('/editor', editorRouter);
}
export default initRoutes;