将任何内容转换为本地无服务器函数
Turn anything into a serverless function.. Docker ready!
jerverless is a serverless runner which will execute anything (binaries, commands or your scripts) as a serverless function. It simply pipes http POST data into STDIN of any executable vice versa.
See more info,
Download Jerverless and extract the archive
Create jerverless.yml
# use port 8080
port: 8080
# enable CORS for the server
cors: '*'
# Define your routes
routes:
# a sample route with
- endpoint: /foo # endpoint /foo
command: python test.py # command to run
contentType: text/html # set content type
- endpoint: /bar #endpoint /bar
command: python test.py --bar # command with an argument
contentType: text/html # set your content type
cors: 'xyz.com' # override cors for this specific routehelloworld.py)We are using python2.7 in example
name = raw_input()
print "Hello %s!" % name $ bin/jerverlessor if you are on windows
$ bin\jerverless.bat $ curl -d Jerverless http://localhost:8080/fooOr simply use template and jump to last step!
$ git clone https://github.com/jerverless/jerverless.git
$ cd jerverless/examples/python $ docker build --no-cache -t jerverless-py . $ docker run -it -p 8080:8080 jerverless-pyCreate docker image for your function and push to dockerhub
Add docker image name to .yml deployment
Clone the repository in your local directory
$ git clone We are using gradle as the build tool. This command will download and install gradle, then it will build the jar file.
Windows users may use .\gradlew instead of ./gradlew It applies to all bash commands listed below.
$ ./gradlew assembleThe resulted jar file can be found in build/libs
$ java -jar build/libs/jerverless-1.0.0.jarOr run
$ ./gradlew assembleDistThis will create distributions of jerverless, you can find them in build/distributions/
To install this distribution in a path you desired try out
$ ./gradlew installDistBy default it will be installed in build/install/jerverless
To run the distribution, try
$ build/install/jerverless/bin/jerverlessSubmit a pull request or raise 3 helpful issues to join jerverless Team!
暂无开放 Issues,或尚未同步最近议题。