2017-11-04 11:00:35 +08:00
|
|
|
const indexRoute = require('./index');
|
|
|
|
const loginRoute = require('./login');
|
|
|
|
const logoutRoute = require('./logout');
|
|
|
|
const migrationRoute = require('./migration');
|
2017-12-04 11:29:23 +08:00
|
|
|
const setupRoute = require('./setup');
|
2017-11-04 11:00:35 +08:00
|
|
|
|
|
|
|
// API routes
|
|
|
|
const treeApiRoute = require('./api/tree');
|
|
|
|
const notesApiRoute = require('./api/notes');
|
2018-01-14 07:02:41 +08:00
|
|
|
const treeChangesApiRoute = require('./api/tree_changes');
|
|
|
|
const cloningApiRoute = require('./api/cloning');
|
2017-11-04 11:00:35 +08:00
|
|
|
const noteHistoryApiRoute = require('./api/note_history');
|
|
|
|
const recentChangesApiRoute = require('./api/recent_changes');
|
|
|
|
const settingsApiRoute = require('./api/settings');
|
|
|
|
const passwordApiRoute = require('./api/password');
|
|
|
|
const migrationApiRoute = require('./api/migration');
|
|
|
|
const syncApiRoute = require('./api/sync');
|
|
|
|
const loginApiRoute = require('./api/login');
|
|
|
|
const eventLogRoute = require('./api/event_log');
|
2017-11-05 11:46:50 +08:00
|
|
|
const recentNotesRoute = require('./api/recent_notes');
|
2017-11-21 13:25:53 +08:00
|
|
|
const appInfoRoute = require('./api/app_info');
|
2017-12-03 10:48:22 +08:00
|
|
|
const exportRoute = require('./api/export');
|
2017-12-03 12:41:18 +08:00
|
|
|
const importRoute = require('./api/import');
|
2017-12-04 11:29:23 +08:00
|
|
|
const setupApiRoute = require('./api/setup');
|
2017-12-15 09:38:56 +08:00
|
|
|
const sqlRoute = require('./api/sql');
|
2017-12-16 13:05:37 +08:00
|
|
|
const anonymizationRoute = require('./api/anonymization');
|
2017-12-23 22:35:00 +08:00
|
|
|
const cleanupRoute = require('./api/cleanup');
|
2018-01-06 12:54:02 +08:00
|
|
|
const imageRoute = require('./api/image');
|
2018-01-11 13:01:16 +08:00
|
|
|
const attributesRoute = require('./api/attributes');
|
2018-01-24 10:59:30 +08:00
|
|
|
const scriptRoute = require('./api/script');
|
2018-02-11 13:18:59 +08:00
|
|
|
const senderRoute = require('./api/sender');
|
2018-02-15 12:31:20 +08:00
|
|
|
const attachmentsRoute = require('./api/attachments');
|
2018-03-24 11:08:29 +08:00
|
|
|
const searchRoute = require('./api/search');
|
2017-11-04 11:00:35 +08:00
|
|
|
|
|
|
|
function register(app) {
|
|
|
|
app.use('/', indexRoute);
|
|
|
|
app.use('/login', loginRoute);
|
|
|
|
app.use('/logout', logoutRoute);
|
|
|
|
app.use('/migration', migrationRoute);
|
2017-12-04 11:29:23 +08:00
|
|
|
app.use('/setup', setupRoute);
|
2017-11-04 11:00:35 +08:00
|
|
|
|
|
|
|
app.use('/api/tree', treeApiRoute);
|
|
|
|
app.use('/api/notes', notesApiRoute);
|
2018-01-14 07:02:41 +08:00
|
|
|
app.use('/api/tree', treeChangesApiRoute);
|
|
|
|
app.use('/api/notes', cloningApiRoute);
|
2018-02-05 08:27:27 +08:00
|
|
|
app.use('/api', attributesRoute);
|
2017-11-04 11:00:35 +08:00
|
|
|
app.use('/api/notes-history', noteHistoryApiRoute);
|
|
|
|
app.use('/api/recent-changes', recentChangesApiRoute);
|
|
|
|
app.use('/api/settings', settingsApiRoute);
|
|
|
|
app.use('/api/password', passwordApiRoute);
|
|
|
|
app.use('/api/migration', migrationApiRoute);
|
|
|
|
app.use('/api/sync', syncApiRoute);
|
|
|
|
app.use('/api/login', loginApiRoute);
|
|
|
|
app.use('/api/event-log', eventLogRoute);
|
2017-11-05 11:46:50 +08:00
|
|
|
app.use('/api/recent-notes', recentNotesRoute);
|
2017-11-21 13:25:53 +08:00
|
|
|
app.use('/api/app-info', appInfoRoute);
|
2017-12-03 10:48:22 +08:00
|
|
|
app.use('/api/export', exportRoute);
|
2017-12-03 12:41:18 +08:00
|
|
|
app.use('/api/import', importRoute);
|
2017-12-04 11:29:23 +08:00
|
|
|
app.use('/api/setup', setupApiRoute);
|
2017-12-15 09:38:56 +08:00
|
|
|
app.use('/api/sql', sqlRoute);
|
2017-12-16 13:05:37 +08:00
|
|
|
app.use('/api/anonymization', anonymizationRoute);
|
2017-12-23 22:35:00 +08:00
|
|
|
app.use('/api/cleanup', cleanupRoute);
|
2018-01-07 10:49:02 +08:00
|
|
|
app.use('/api/images', imageRoute);
|
2018-01-24 10:59:30 +08:00
|
|
|
app.use('/api/script', scriptRoute);
|
2018-02-11 13:18:59 +08:00
|
|
|
app.use('/api/sender', senderRoute);
|
2018-02-15 12:31:20 +08:00
|
|
|
app.use('/api/attachments', attachmentsRoute);
|
2018-03-24 11:08:29 +08:00
|
|
|
app.use('/api/search', searchRoute);
|
2017-11-04 11:00:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
register
|
|
|
|
};
|