gitserverless 0.0.3
Create a Serverless service in Git hosting
Requires Python: >=3.6

# GitServerless - Create a serverless service in Git hosting

[![ActionServerless Testing](https://github.com/gitx-io/GitServerless/workflows/Test%20run%20funcs/badge.svg)](https://github.com/gitx-io/GitServerless/blob/master/.github/workflows/test_run_funcs.yml)

GitServerless is a Python lib extracted from an action [ActionServerless](https://github.com/gitx-io/ActionServerless). The Action will use this lib as a dependency after that.

## Install

```shell
pip3 install gitserverless

# or
python3 -m pip install gitserverless
```

Note: Python 2 is not supported

## Usage

Let's start with a Python code that'll be used to create a serverless service:

```python
# function.py
import json

# GET /api/py_hello.json

print(json.dumps({"hello": "world"}))
```

put the program to a path under current directory, for example, `test` folder and run:

```shell
python3 -m gitserverless test/
```

then the program's output is written to a file located in `api/py_hello.json` that you defined as a route in the comment.

more languages' examples you can find [here](https://github.com/gitx-io/GitServerless/tree/master/test/func_examples).

## Languages supported

| Language      | Dependency Installation | Example code                                                                               |
| ------------- | -------------         | :------------:                                                                               |
| Python        | ✅ `requirements.txt`   | [See](https://github.com/gitx-io/GitServerless/blob/master/test/func_examples/function.py)      |
| Ruby          | ✅ `Gemfile`            | [See](https://github.com/gitx-io/GitServerless/blob/master/test/func_examples/function.rb)      |
| Node.js       | ✅ `package.json`       | [See](https://github.com/gitx-io/GitServerless/blob/master/test/func_examples/function.js)      |
| Perl          | ✅ `cpanfile`           | [See](https://github.com/gitx-io/GitServerless/blob/master/test/func_examples/function.pl)      |
| Golang        | ⬜️ not supported yet    | [See](https://github.com/gitx-io/GitServerless/blob/master/test/func_examples/function.go)      |
| Haskell       | ⬜️ not supported yet    | [See](https://github.com/gitx-io/GitServerless/blob/master/test/func_examples/function.hs)      |
| Elixir        | ⬜️ not supported yet    | [See](https://github.com/gitx-io/GitServerless/blob/master/test/func_examples/function.exs)     |
| PHP           | ⬜️ not supported yet    | [See](https://github.com/gitx-io/GitServerless/blob/master/test/func_examples/function.php)     |
| Bash          | -                       | [See](https://github.com/gitx-io/GitServerless/blob/master/test/func_examples/function.sh) |

## Documents

* [Pre-hook script](https://github.com/gitx-io/ActionServerless/wiki/Pre-hook-script)
* [HTTP Headers](https://github.com/gitx-io/ActionServerless/wiki/HTTP-Headers)

## Real world examples

* [Shell functions to get Docker image versions](https://github.com/gitx-io?q=docker-major-versions&type=public&language=shell&sort=name)

## Contributions

Contributions are welcome! You may check the following features in case you'd like to contribute but no idea what to do:

* Support to add your favorite languages
* Support dependency installation to the existing languages
* Use this action to create an application and share it