Commit a58d8928 authored by Yuanle Song's avatar Yuanle Song
Browse files

tried aliyun lambda.

it is not ready for use with this project.
parent e5ca5596
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
.fun/build
.idea
.mvn
.settings
src
.classpath
.project
.gitignore
*.iml
*.md
mvnw*
pom.xml
template.yml
target/*
!target/demo.jar
.funignore
__MACOSX
.DS_Store
Makefile
operational
+37 −0
Original line number Diff line number Diff line
get-client-ip
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/

### VS Code ###
.vscode/
.settings/
.classpath
.project

### Fun ###
.fun/

aliyun-lambda/Makefile

0 → 100644
+11 −0
Original line number Diff line number Diff line
STACK_LOCAL_INSTALL_ROOT := $(shell stack path --local-install-root)

default:
build:
	cd .. && stack build
	cp -l "$(STACK_LOCAL_INSTALL_ROOT)/bin/get-client-ip" get-client-ip
deploy:
	fun deploy
test:
	fun local invoke get-client-ip/get-client-ip
.PHONY: default build deploy test
+5 −0
Original line number Diff line number Diff line
#!/bin/bash
echo "Running bootstrap..."
echo "will listen on port $FC_SERVER_PORT"
env PORT=$FC_SERVER_PORT ./get-client-ip
# env PORT=$FC_SERVER_PORT python3 minial-web-server.py
+28 −0
Original line number Diff line number Diff line
from http.server import HTTPServer, SimpleHTTPRequestHandler


PORT = 9000


class Handler(SimpleHTTPRequestHandler):

    def do_GET(self):
        self.send_response(200)
        self.end_headers()
        self.wfile.write(b'Hello World!\n')


    def do_POST(self):
        self.send_response(201)
        self.end_headers()
        self.wfile.write(b'Some resource created!\n')


def main():
    httpd = HTTPServer(('', PORT), Handler)
    print("serving at port", PORT)
    httpd.serve_forever()


if __name__ == '__main__':
    main()
Loading