
// Configure the Feathers services. (Can be re-generated.)
<%- tplTsOnly([`import { App } from '../app.interface'${sc}`, '']) -%>
<%# -%>
<%# --- forEach-1 starts below. Loop thru the services. -%>
<% Object.keys(specs.services || {}).sort().forEach(__name => {
  __fileName = specs.services[__name].fileName || __name;
  __subFolder = getNameSpace(specs.services[__name].subFolder || '')[0];
-%>
<%- tplImports(__name, `./${__subFolder}${__fileName}/${__fileName}.service`, null, 'let') %>
<% }); -%>
<%# --- forEach-1 ends above. -%>

<%# -%>
<%# --- if-1 starts below. -%>
<% if (specs.graphql && specs.graphql.path && !specs.graphql.doNotConfigure) { -%>
<%- tplImports('graphql', './graphql/graphql.service', null, 'let') %>
<% } -%>
<%# --- if-1 ends above. -%>
<%- insertFragment('imports') %>
<%- insertFragment('init') %>

// <%- lintDisableNextLineUnused %>
<%- tplModuleExports(null, 'function (app) {', 'function (app: App) {') %>
<%# -%>
<%# --- forEach-2 starts below. Loop thru the services. -%>
<% Object.keys(specs.services || {}).sort().forEach(__name => { -%>
  app.configure(<%- __name %>)<%- sc %>
<% }); -%>
<%# --- forEach-2 ends above. -%>
<%# -%>
<%# --- if-2 starts below. -%>
<% if (specs.graphql && specs.graphql.name && !specs.graphql.doNotConfigure) { %>
  app.configure(<%- specs.graphql.name %>)<%- sc %>
<% } -%>
<%# --- if-2 ends above. -%>
  <%- insertFragment('func_return') %>
}<%- sc %>

<%- insertFragment('exports') %>
<%- `${tplExport('moduleExports')}${sc}` %>

<%- insertFragment('funcs') %>
<%- insertFragment('end') %>
