<% // Test output in playground // https://ionicabizau.github.io/ejs-playground/ // Input variables // const configExtension = 'yml'; // const isSdk = true; // Inline variables const name = 'Rfam'; const handler = 'mysql'; const port = 4497; const user = 'rfamro'; const database = 'Rfam'; const host = 'mysql-rfam-public.ebi.ac.uk'; const browser = false; const fileRoot = './src/'; const documents = `${fileRoot}graphql/**/*.*.graphql`; if (configExtension === 'cjs' || configExtension ==='js') { -%> module.exports = { sources: [ { name: '<%= name %>', handler: { <%= handler %>: { database: '<%= database %>', port: <%= port %>, host: '<%= host %>', user: '<%= user %>', }, }, }, ], serve: { browser: <%= browser %>, }, documents: ['<%= documents %>'], }; <% } else if (configExtension === 'json') { -%> { "sources": [ { "name": "<%= name %>", "handler": { "<%= handler %>": { database: "<%= database %>", port: <%= port %>, host: "<%= host %>", user: "<%= user %>" } } } ], "serve": { "browser": <%= browser %> }, "documents": ['<%= documents %>'] } <% } else if (configExtension === 'yml') { -%> sources: - name: <%= name %> handler: <%= handler %>: database: <%= database %> port: <%= port %> host: <%= host %> user: <%= user %> serve: browser: false documents: - <%= documents %> <% }-%>