52 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-03-18 11:12:50 +01:00
'use strict';
/**
* Module dependencies
*/
// Node.js core.
const path = require('path');
// FIXME
/* eslint-disable import/extensions */
2016-03-18 11:12:50 +01:00
// Local dependencies.
const routesJSON = require('../json/routes.json.js');
/**
* Generate a core API
*/
module.exports = {
templatesDirectory: path.resolve(__dirname, '..', 'templates'),
2016-03-18 11:12:50 +01:00
before: require('./before'),
targets: {
// Use the default `controller` file as a template for
// every generated controller.
2019-10-31 14:34:30 +01:00
':filePath/controllers/:filename': {
template: 'controller.template',
2016-03-18 11:12:50 +01:00
},
// every generated controller.
2019-10-31 14:34:30 +01:00
':filePath/services/:filename': {
template: 'service.template',
2016-03-18 11:12:50 +01:00
},
// Copy an empty JavaScript model where every functions will be.
2019-10-31 14:34:30 +01:00
':filePath/models/:filename': {
template: 'model.template',
2016-03-18 11:12:50 +01:00
},
// Copy the generated JSON model for the connection,
// schema and attributes.
2019-10-31 14:34:30 +01:00
':filePath/models/:filenameSettings': {
template: 'model.settings.template',
2016-03-18 11:12:50 +01:00
},
// Generate routes.
2019-10-31 14:34:30 +01:00
':filePath/config/routes.json': {
jsonfile: routesJSON,
},
},
2016-03-18 11:12:50 +01:00
};