backend/app/routing/routers/api/v1/database.routes.js
2020-03-01 15:37:52 -06:00

44 lines
1.1 KiB
JavaScript

module.exports = exports = {
prefix: '/db_api/v1',
middleware: [
// JWT authorization middleware. Sets req.user and req.token.
// Second param is array of required grants.
['api:auth:BearerToken', ['database']],
],
get: {
'/': [ 'controller::api:v1:DatabaseAPI.databases' ],
'/:database_id': [
'middleware::api:DatabaseRoute',
'controller::api:v1:DatabaseAPI.get_database',
],
'/:database_id/columns': [
'middleware::api:DatabaseRoute',
'controller::api:v1:DatabaseAPI.get_columns',
],
'/:database_id/columns/order': [
'middleware::api:DatabaseRoute',
'controller::api:v1:DatabaseAPI.get_columns_order',
],
'/:database_id/data': [
'middleware::api:DatabaseRoute',
'controller::api:v1:DatabaseAPI.get_data',
],
'/:database_id/record/:record_id': [
'middleware::api:DatabaseRoute',
'controller::api:v1:DatabaseAPI.get_record',
],
},
post: {
},
}