mirror of
https://github.com/strapi/strapi.git
synced 2025-07-06 08:31:30 +00:00
48 lines
991 B
JavaScript
Executable File
48 lines
991 B
JavaScript
Executable File
'use strict';
|
|
|
|
/**
|
|
* Module dependencies
|
|
*/
|
|
|
|
// Node.js core.
|
|
const path = require('path');
|
|
|
|
// Local dependencies.
|
|
const packageJSON = require('../json/package.json.js');
|
|
const routesJSON = require('../json/routes.json.js');
|
|
|
|
/**
|
|
* Generate a core API
|
|
*/
|
|
|
|
module.exports = {
|
|
templatesDirectory: path.resolve(__dirname, '..', 'templates'),
|
|
before: require('./before'),
|
|
targets: {
|
|
'plugins/:humanizeId/.gitignore': {
|
|
copy: 'gitignore'
|
|
},
|
|
|
|
// Use the default `controller` file as a template for
|
|
// every generated controller.
|
|
'plugins/:humanizeId/controllers/:filename': {
|
|
template: 'controller.template'
|
|
},
|
|
|
|
// every generated controller.
|
|
'plugins/:humanizeId/services/:filename': {
|
|
template: 'service.template'
|
|
},
|
|
|
|
// Generate routes.
|
|
'plugins/:humanizeId/config/routes.json': {
|
|
jsonfile: routesJSON
|
|
},
|
|
|
|
// Main package.
|
|
'plugins/:humanizeId/package.json': {
|
|
jsonfile: packageJSON
|
|
},
|
|
}
|
|
};
|