mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-03 19:36:20 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			47 lines
		
	
	
		
			944 B
		
	
	
	
		
			JavaScript
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			944 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: () => {
 | 
						|
    return path.resolve(__dirname, '..', 'templates');
 | 
						|
  },
 | 
						|
  before: require('./before'),
 | 
						|
  targets: {
 | 
						|
 | 
						|
    // 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
 | 
						|
    },
 | 
						|
  }
 | 
						|
};
 |