-
Notifications
You must be signed in to change notification settings - Fork 2
/
routes.ts
22 lines (19 loc) · 844 Bytes
/
routes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import * as document from "./controllers/document";
import * as swagger from "./controllers/swagger"
export function setRoutes(server) {
// Document operations
server.post('/docs', document.post);
server.post('/docs/', document.post);
server.get('/docs/:id', document.getOrDel);
server.del('/docs/:id', document.getOrDel);
server.put('/docs/:id', document.put);
server.put('/docs', document.upsert);
server.put('/docs/', document.upsert);
server.post('/query/docs', document.query);
server.post('/query/docs/', document.query);
server.get('/swagger', swagger.get );
server.get('/', function(req, res, next) {
res.send(`Azure DocumentDB Connector - swagger at https://${req.headers['host']}/swagger`);
next();
})
}