mirror of
https://github.com/strapi/strapi.git
synced 2025-07-24 17:40:18 +00:00
58 lines
1.1 KiB
JavaScript
Executable File
58 lines
1.1 KiB
JavaScript
Executable File
'use strict';
|
|
|
|
/**
|
|
* Module dependencies
|
|
*/
|
|
|
|
// Node.js core.
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
// Public node modules.
|
|
const _ = require('lodash');
|
|
|
|
/**
|
|
* Expose main routes of the generated API
|
|
*/
|
|
|
|
module.exports = scope => {
|
|
return {
|
|
routes: [{
|
|
method: 'GET',
|
|
path: '/ ' + scope.humanizeId,
|
|
handler: scope.globalID + '.find',
|
|
config: {
|
|
policies: []
|
|
}
|
|
}, {
|
|
method: 'GET',
|
|
path: '/ ' + scope.humanizeId + '/:id',
|
|
handler: scope.globalID + '.findOne',
|
|
config: {
|
|
policies: []
|
|
}
|
|
}, {
|
|
method: 'POST',
|
|
path: '/ ' + scope.humanizeId,
|
|
handler: scope.globalID + '.create',
|
|
config: {
|
|
policies: []
|
|
}
|
|
}, {
|
|
method: 'PUT',
|
|
path: '/ ' + scope.humanizeId + '/:id',
|
|
handler: scope.globalID + '.update',
|
|
config: {
|
|
policies: []
|
|
}
|
|
}, {
|
|
method: 'DELETE',
|
|
path: '/ ' + scope.humanizeId + '/:id',
|
|
handler: scope.globalID + '.destroy',
|
|
config: {
|
|
policies: []
|
|
}
|
|
}]
|
|
};
|
|
};
|