Sha256: 6734308b0fed7bd11154d116a2b9664fc40e51431505425128d0fb64ec5c5b8d

Contents?: true

Size: 667 Bytes

Versions: 4

Compression:

Stored size: 667 Bytes

Contents

module Template
  module Nodejs
    def self.index(file_name)
      file_name.underscore.camelize(:lower)
      <<~APP
        const express = require('express');
        const bodyParser = require('body-parser');

        const app = express();
        app.use(bodyParser.urlencoded({ extended: true }));

        app.get('/souls-functions-get', (req, res)=>{
          res.json(req.query)
        });

        app.get('/souls-functions-get/:id', (req, res)=>{
          res.json(req.params)
        });

        app.post('/souls-functions-post', (req, res)=>{
          res.json(req.body)
        });
        exports.#{file_name} = app;
      APP
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
souls-1.19.4 lib/souls/cli/create/templates/nodejs/index.rb
souls-1.19.3 lib/souls/cli/create/templates/nodejs/index.rb
souls-1.19.2 lib/souls/cli/create/templates/nodejs/index.rb
souls-1.19.1 lib/souls/cli/create/templates/nodejs/index.rb