mirror of
https://github.com/strapi/strapi.git
synced 2025-09-08 16:16:21 +00:00
25 lines
495 B
JavaScript
25 lines
495 B
JavaScript
'use strict';
|
|
|
|
const { join } = require('path');
|
|
|
|
module.exports = function(plop) {
|
|
// Service generator
|
|
plop.setGenerator('service', {
|
|
description: 'application service logic',
|
|
prompts: [
|
|
{
|
|
type: 'input',
|
|
name: 'id',
|
|
message: 'service name please',
|
|
},
|
|
],
|
|
actions: [
|
|
{
|
|
type: 'add',
|
|
path: join(process.cwd(), 'api/{{id}}/services/{{id}}.js'),
|
|
templateFile: 'templates/service.js.hbs',
|
|
},
|
|
],
|
|
});
|
|
};
|