-
Notifications
You must be signed in to change notification settings - Fork 1
/
routes.js
31 lines (27 loc) · 1.09 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
// Load the route handlers
var routes = require('./handlers');
var library = require('./handlers/library');
var documents = require('./handlers/documents');
var statements = require('./handlers/statements');
var data = require('./handlers/data');
var rdf = require('./handlers/rdf');
//apis
var api = require('./handlers/api');
var statementsApi = require('./handlers/statementsApi');
module.exports = function(app, apiContext) {
//routes
app.get('/', routes.index);
app.get('/library', library.index);
app.get('/resources/D:id.:type?', documents.list);
app.get('/resources/S:id.:type?', statements.list);
app.get('/data/:id', data.json);
app.get('/rdf/:id', rdf.xml);
//api routes
app.get('/api',api.index);
app.get(apiContext + 'statements', statementsApi.list);
app.get(apiContext + 'statements/search', statementsApi.list);
app.post(apiContext + 'statements', statementsApi.create);
app.get(apiContext + 'statements/:id', statementsApi.show);
app.delete(apiContext + 'statements/:id', statementsApi.destroy);
app.put(apiContext + 'statements/:id', statementsApi.update);
};