-
Notifications
You must be signed in to change notification settings - Fork 0
/
routesapi.js
executable file
·28 lines (22 loc) · 1.35 KB
/
routesapi.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
'use strict';
const PoiApi = require('./api/pois');
const RegionApi = require('./api/regions');
const Users = require('./api/users');
module.exports = [
{ method: 'GET', path: '/api/user', config: Users.find },
{ method: 'GET', path: '/api/user/{id}', config: Users.findOne },
{ method: 'POST', path: '/api/user', config: Users.create },
{ method: 'DELETE', path: '/api/user/{id}', config: Users.delete },
{ method: 'DELETE', path: '/api/user', config: Users.deleteAll },
{ method: 'POST', path: '/api/user/authenticate', config: Users.authenticate },
{ method: 'GET', path: '/api/region/{region_id}/poi', config: PoiApi.find },
{ method: 'GET', path: '/api/region/{region_id}/poi/{poi_id}', config: PoiApi.find },
{ method: 'POST', path: '/api/region/{region_id}/poi', config: PoiApi.create },
{ method: 'DELETE', path: '/api/region/{region_id}/poi/{poi_id}', config: PoiApi.delete },
{ method: 'DELETE', path: '/api/region/{region_id}/poi', config: PoiApi.deleteAll },
{ method: 'GET', path: '/api/region', config: RegionApi.find },
{ method: 'GET', path: '/api/region/{region_id}', config: RegionApi.findOne },
{ method: 'POST', path: '/api/region', config: RegionApi.create },
{ method: 'DELETE', path: '/api/region/{region_id}', config: RegionApi.delete },
{ method: 'DELETE', path: '/api/region', config: RegionApi.deleteAll },
];