You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
976 B
29 lines
976 B
4 years ago
|
module.exports = exports = {
|
||
|
|
||
|
prefix: '/api/v1/files',
|
||
|
|
||
|
middleware: [
|
||
|
'auth:ApiRoute',
|
||
|
],
|
||
|
|
||
|
get: {
|
||
|
// Get the file ref node config for the specified file ref
|
||
|
'/:PageId/:NodeId/get/:FilesId': ['controller::api:v1:File.get_config'],
|
||
|
|
||
|
// Download the specified file ID from the specified file ref node
|
||
|
'/:PageId/:NodeId/get/:FilesId/:FileId': ['controller::api:v1:File.download'],
|
||
|
},
|
||
|
|
||
|
post: {
|
||
|
// FIXME - files, not file. Fix in front-end!
|
||
|
// Upload the file in the 'uploaded_file' key to the specified file ref node
|
||
|
'/file/upload/:PageId/:NodeId/:FilesId': ['middleware::upload:UploadFile', 'controller::api:v1:File.save_upload'],
|
||
|
|
||
|
// Create a new file ref node
|
||
|
'/:PageId/:NodeId/create': ['controller::api:v1:File.create_config'],
|
||
|
|
||
|
// Delete a file ref node and its files
|
||
|
'/:PageId/:NodeId/delete/:FilesId': ['controller::api:v1:File.delete_group'],
|
||
|
},
|
||
|
}
|