1.0.18 • Published 2 years ago

google-function-http-tool v1.0.18

Weekly downloads
2
License
GNU GPLv3
Repository
github
Last release
2 years ago

google-function-http-tool

=========

A simple google function creator, it makes your google function code small with default provided setting; you just have to add what you need to add , no more unnecessary coding! Everything is configured , and also can be fine tuned with custom stuff. You can create normal express app too with this tool.

Installation

npm install google-function-http-tool

Usage

const gFunction = require('google-function-http-tool');
const genericHandlers = gFunction.genericHandlers;
const initiateExpress = gFunction.initiateExpress
// import { genericHandlers, routes, initiateExpress } from "google-function-http-tool";

let AppUtility = new genericHandlers();
const [errInfo, Info] = [AppUtility.errorInfo, AppUtility.info]
let routes = [{
 type: 'GET',
 path: '/AB',
 requesthandler: (req, res) => {
    Info('success', 'AB', 5 )
    res.status(200).send(AppUtility.generate(false, 'success', 0, {AB: 'AB'}))
}
 }, 
{type: 'POST',
 path: '/CD', 
 requesthandler: (req, res) => {
    Info('success', 'CD', 5 );
    res.status(200).send(AppUtility.generate(false, 'success', 0, {AB: req.body.cd}))
}
 }
];
let application = new initiateExpress({routes})
application.initiateAppEngine();
module.exports ={app: application.app}

// in google function just put app in Function to execute input box.

Tests

npm run test

curl --location --request POST 'http://localhost:4000/CD' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'cd=sdsfsdfsd'

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago