From 4414ff6cd7872017abdd8c6fa5e34579aec378c2 Mon Sep 17 00:00:00 2001
From: rsonghuster
Date: Mon, 3 Apr 2023 18:10:24 +0800
Subject: [PATCH] add java11 example
---
event-function/fc-event-java11/cloudshell.md | 68 ++++++++++++++
event-function/fc-event-java11/hook/index.js | 24 +++++
event-function/fc-event-java11/publish.yaml | 60 +++++++++++++
event-function/fc-event-java11/readme.md | 81 +++++++++++++++++
event-function/fc-event-java11/src/pom.xml | 50 +++++++++++
event-function/fc-event-java11/src/readme.md | 81 +++++++++++++++++
event-function/fc-event-java11/src/s.yaml | 74 +++++++++++++++
event-function/fc-event-java11/src/s_en.yaml | 74 +++++++++++++++
.../src/src/main/java/example/App.java | 26 ++++++
event-function/fc-event-java11/version.md | 1 +
http-function/fc-http-java11/cloudshell.md | 68 ++++++++++++++
http-function/fc-http-java11/hook/index.js | 24 +++++
http-function/fc-http-java11/publish.yaml | 60 +++++++++++++
http-function/fc-http-java11/readme.md | 81 +++++++++++++++++
http-function/fc-http-java11/src/pom.xml | 50 +++++++++++
http-function/fc-http-java11/src/readme.md | 81 +++++++++++++++++
http-function/fc-http-java11/src/s.yaml | 90 +++++++++++++++++++
http-function/fc-http-java11/src/s_en.yaml | 89 ++++++++++++++++++
.../src/src/main/java/example/App.java | 41 +++++++++
http-function/fc-http-java11/version.md | 1 +
readme.md | 80 +++++++++--------
update.list | 4 +-
22 files changed, 1167 insertions(+), 41 deletions(-)
create mode 100644 event-function/fc-event-java11/cloudshell.md
create mode 100644 event-function/fc-event-java11/hook/index.js
create mode 100644 event-function/fc-event-java11/publish.yaml
create mode 100644 event-function/fc-event-java11/readme.md
create mode 100644 event-function/fc-event-java11/src/pom.xml
create mode 100644 event-function/fc-event-java11/src/readme.md
create mode 100644 event-function/fc-event-java11/src/s.yaml
create mode 100644 event-function/fc-event-java11/src/s_en.yaml
create mode 100644 event-function/fc-event-java11/src/src/main/java/example/App.java
create mode 100644 event-function/fc-event-java11/version.md
create mode 100644 http-function/fc-http-java11/cloudshell.md
create mode 100644 http-function/fc-http-java11/hook/index.js
create mode 100644 http-function/fc-http-java11/publish.yaml
create mode 100644 http-function/fc-http-java11/readme.md
create mode 100644 http-function/fc-http-java11/src/pom.xml
create mode 100644 http-function/fc-http-java11/src/readme.md
create mode 100644 http-function/fc-http-java11/src/s.yaml
create mode 100644 http-function/fc-http-java11/src/s_en.yaml
create mode 100644 http-function/fc-http-java11/src/src/main/java/example/App.java
create mode 100644 http-function/fc-http-java11/version.md
diff --git a/event-function/fc-event-java11/cloudshell.md b/event-function/fc-event-java11/cloudshell.md
new file mode 100644
index 0000000..27bd68c
--- /dev/null
+++ b/event-function/fc-event-java11/cloudshell.md
@@ -0,0 +1,68 @@
+# 快速体验 Java11 Event 函数案例
+
+欢迎您使用 Serverless Devs 开发者工具进行项目开发,本实验是基于 Serverless Devs 部署 Java11 Event 案例到阿里云函数计算。
+
+整个实验过程包括:
+
+- [下载工具](#下载工具)
+- [配置密钥](#配置密钥)
+- [初始化项目](#初始化项目)
+- [部署项目](#部署项目)
+- [更多信息](#更多信息)
+
+> - [:octocat: 源代码](https://github.com/devsapp/start-fc/tree/main/event-function/fc-event-java11/src)
+
+## 下载工具
+
+> 由于本系统已经默认集成了 Serverless Devs,所以该步骤在本次试验中可以跳过
+
+通过`npm`安装 Serverless Devs 开发者工具:
+
+```
+npm install -g @serverless-devs/s
+```
+
+除了上述的安装方法之外,您还可以参考[Serverless Devs Cli 安装文档](https://www.serverless-devs.com/serverless-devs/install) 查看更多安装方法。
+
+## 配置密钥
+
+> 由于本系统已经配置了密钥信息,所以该步骤在本次试验中可以跳过
+
+配置阿里云账号的 AccessKeyID, AccessKeySecret 以及密钥别名。
+
+配置方法可以通过`s config add`指令,选择`Alibaba Cloud`并根据提示进行配置。
+
+除了上述的配置方法之外,您还可以参考[Serverless Devs 配置阿里云密钥信息](https://www.serverless-devs.com/fc/config) 查看更多密钥配置方法。
+
+## 初始化项目
+
+进行项目初始化:
+
+```
+s init start-fc-event-java11 -d start-fc-event-java11
+```
+
+在初始化的过程中,可能涉及到部分服务的开通、参数的获取以及参数的定义,请根据命令行的提醒进行具体的操作。
+
+## 部署项目
+
+- 进入项目:`cd start-fc-event-java11`
+- 进行项目的部署:`s deploy`
+
+稍等片刻,即可完成项目的部署。
+
+## 更多信息
+
+- 组件仓库地址:https://github.com/devsapp/fc
+- 组件帮助文档:https://www.serverless-devs.com/fc/readme
+- Yaml 参考文档:https://www.serverless-devs.com/fc/yaml/readme
+- 关于:
+ - Serverless Devs 和 FC 组件的关系、如何声明/部署多个函数、超过 50M 的代码包如何部署
+ - 关于.fcignore 使用方法、工具中.s 目录是做什么、函数进行 build 操作之后如何处理 build 的产物
+ 等问题,可以参考文档:https://www.serverless-devs.com/fc/tips
+- 关于如何做 CICD 等问题,可以参考:https://www.serverless-devs.com/serverless-devs/cicd
+- 关于如何进行环境划分等问题,可以参考:https://www.serverless-devs.com/serverless-devs/extend
+
+更多函数计算案例,可参考:https://github.com/devsapp/awesome/
+
+> 有问题快来钉钉群问一下吧:33947367
diff --git a/event-function/fc-event-java11/hook/index.js b/event-function/fc-event-java11/hook/index.js
new file mode 100644
index 0000000..f588568
--- /dev/null
+++ b/event-function/fc-event-java11/hook/index.js
@@ -0,0 +1,24 @@
+async function preInit(inputObj) {
+ console.log(`
+ Serverless Devs Application Case
+
+ Cloud services required:
+ - FC : https://fc.console.aliyun.com/
+
+ Tips:
+ - FC Component: https://www.serverless-devs.com/fc/readme`)
+
+}
+
+async function postInit(inputObj) {
+ console.log(`
+ * Before using, please check whether the actions command in Yaml file is available
+ * Carefully reading the notes in s.yaml is helpful for the use of the tool
+ * If need help in the use process, please apply to join the Dingtalk Group: 33947367
+ `)
+}
+
+module.exports = {
+ postInit,
+ preInit
+}
diff --git a/event-function/fc-event-java11/publish.yaml b/event-function/fc-event-java11/publish.yaml
new file mode 100644
index 0000000..fa6e9e9
--- /dev/null
+++ b/event-function/fc-event-java11/publish.yaml
@@ -0,0 +1,60 @@
+Type: Application
+Name: start-fc-event-java11
+Version: 0.0.1
+Provider:
+ - 阿里云
+Description: 快速部署一个 Java 11 的 Event 类型的 Hello World 函数到阿里云函数计算。
+HomePage: https://github.com/devsapp/start-fc
+Tags:
+ - 函数计算
+ - 你好世界
+ - 新手入门
+Category: 新手入门
+Service:
+ 函数计算:
+ Authorities:
+ - AliyunFCFullAccess
+ Runtime: Java11
+Parameters:
+ type: object
+ additionalProperties: false # 不允许增加其他属性
+ required: # 必填项
+ - region
+ - serviceName
+ - functionName
+ properties:
+ region:
+ title: 地域
+ type: string
+ default: cn-hangzhou
+ description: 创建应用所在的地区
+ enum:
+ - cn-beijing
+ - cn-hangzhou
+ - cn-shanghai
+ - cn-qingdao
+ - cn-zhangjiakou
+ - cn-huhehaote
+ - cn-shenzhen
+ - cn-chengdu
+ - cn-hongkong
+ - ap-southeast-1
+ - ap-southeast-2
+ - ap-southeast-3
+ - ap-southeast-5
+ - ap-northeast-1
+ - eu-central-1
+ - eu-west-1
+ - us-west-1
+ - us-east-1
+ - ap-south-1
+ serviceName:
+ title: 服务名
+ type: string
+ default: hello-world-service
+ description: 服务名称,只能包含字母、数字、下划线和中划线。不能以数字、中划线开头。长度在 1-128 之间
+ functionName:
+ title: 函数名
+ type: string
+ default: start-fc-event-java11
+ description: 函数名称,只能包含字母、数字、下划线和中划线。不能以数字、中划线开头。长度在 1-64 之间
\ No newline at end of file
diff --git a/event-function/fc-event-java11/readme.md b/event-function/fc-event-java11/readme.md
new file mode 100644
index 0000000..f7a7aed
--- /dev/null
+++ b/event-function/fc-event-java11/readme.md
@@ -0,0 +1,81 @@
+# start-fc-event-java11 帮助文档
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+快速部署一个 Java 11 的 Event 类型的 Hello World 函数到阿里云函数计算。
+
+
+
+
+
+## 前期准备
+
+使用该项目,推荐您拥有以下的产品权限 / 策略:
+
+| 服务/业务 | 函数计算 |
+| --------- | ------------------ |
+| 权限/策略 | AliyunFCFullAccess |
+
+
+
+
+
+# 代码 & 预览
+
+- [ :smiley_cat: 源代码](https://github.com/devsapp/start-fc/blob/main/event-function/fc-event-java11)
+
+
+
+
+
+## 部署 & 体验
+
+
+
+- :fire: 通过 [Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-fc-event-java11) ,
+ [![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-fc-event-java11) 该应用。
+
+
+
+- 通过 [Serverless Devs Cli](https://www.serverless-devs.com/serverless-devs/install) 进行部署:
+ - [安装 Serverless Devs Cli 开发者工具](https://www.serverless-devs.com/serverless-devs/install) ,并进行[授权信息配置](https://www.serverless-devs.com/fc/config) ;
+ - 初始化项目:`s init start-fc-event-java11 -d start-fc-event-java11`
+ - 进入项目,并进行项目部署:`cd start-fc-event-java11 && s deploy -y`
+
+
+
+
+
+# 应用详情
+
+本应用仅作为学习和参考使用,您可以基于本项目进行二次开发和完善,实现自己的业务逻辑
+
+
+
+
+
+## 开发者社区
+
+您如果有关于错误的反馈或者未来的期待,您可以在 [Serverless Devs repo Issues](https://github.com/serverless-devs/serverless-devs/issues) 中进行反馈和交流。如果您想要加入我们的讨论组或者了解 FC 组件的最新动态,您可以通过以下渠道进行:
+
+
+
+| | | |
+| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
+|
微信公众号:`serverless` | 微信小助手:`xiaojiangwh` | 钉钉交流群:`33947367` |
+
+
+
+
diff --git a/event-function/fc-event-java11/src/pom.xml b/event-function/fc-event-java11/src/pom.xml
new file mode 100644
index 0000000..9ed86a1
--- /dev/null
+++ b/event-function/fc-event-java11/src/pom.xml
@@ -0,0 +1,50 @@
+
+ 4.0.0
+ example
+ HelloFCJava
+ jar
+ 1.0-SNAPSHOT
+ HelloFCJava
+
+
+
+ junit
+ junit
+ 3.8.1
+ test
+
+
+ com.aliyun.fc.runtime
+ fc-java-core
+ 1.3.0
+
+
+
+
+
+
+ maven-assembly-plugin
+
+
+ jar-with-dependencies
+
+
+
+
+ make-my-jar-with-dependencies
+ package
+
+ single
+
+
+
+
+
+
+
+
+ 11
+ true
+
+
diff --git a/event-function/fc-event-java11/src/readme.md b/event-function/fc-event-java11/src/readme.md
new file mode 100644
index 0000000..f7a7aed
--- /dev/null
+++ b/event-function/fc-event-java11/src/readme.md
@@ -0,0 +1,81 @@
+# start-fc-event-java11 帮助文档
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+快速部署一个 Java 11 的 Event 类型的 Hello World 函数到阿里云函数计算。
+
+
+
+
+
+## 前期准备
+
+使用该项目,推荐您拥有以下的产品权限 / 策略:
+
+| 服务/业务 | 函数计算 |
+| --------- | ------------------ |
+| 权限/策略 | AliyunFCFullAccess |
+
+
+
+
+
+# 代码 & 预览
+
+- [ :smiley_cat: 源代码](https://github.com/devsapp/start-fc/blob/main/event-function/fc-event-java11)
+
+
+
+
+
+## 部署 & 体验
+
+
+
+- :fire: 通过 [Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-fc-event-java11) ,
+ [![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-fc-event-java11) 该应用。
+
+
+
+- 通过 [Serverless Devs Cli](https://www.serverless-devs.com/serverless-devs/install) 进行部署:
+ - [安装 Serverless Devs Cli 开发者工具](https://www.serverless-devs.com/serverless-devs/install) ,并进行[授权信息配置](https://www.serverless-devs.com/fc/config) ;
+ - 初始化项目:`s init start-fc-event-java11 -d start-fc-event-java11`
+ - 进入项目,并进行项目部署:`cd start-fc-event-java11 && s deploy -y`
+
+
+
+
+
+# 应用详情
+
+本应用仅作为学习和参考使用,您可以基于本项目进行二次开发和完善,实现自己的业务逻辑
+
+
+
+
+
+## 开发者社区
+
+您如果有关于错误的反馈或者未来的期待,您可以在 [Serverless Devs repo Issues](https://github.com/serverless-devs/serverless-devs/issues) 中进行反馈和交流。如果您想要加入我们的讨论组或者了解 FC 组件的最新动态,您可以通过以下渠道进行:
+
+
+
+| | | |
+| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
+|
微信公众号:`serverless` | 微信小助手:`xiaojiangwh` | 钉钉交流群:`33947367` |
+
+
+
+
diff --git a/event-function/fc-event-java11/src/s.yaml b/event-function/fc-event-java11/src/s.yaml
new file mode 100644
index 0000000..9f1fcb2
--- /dev/null
+++ b/event-function/fc-event-java11/src/s.yaml
@@ -0,0 +1,74 @@
+# ------------------------------------
+# If you need English case, you can refer to [s_en.yaml] file
+# ------------------------------------
+# 欢迎您使用阿里云函数计算 FC 组件进行项目开发
+# 组件仓库地址:https://github.com/devsapp/fc
+# 组件帮助文档:https://www.serverless-devs.com/fc/readme
+# Yaml参考文档:https://www.serverless-devs.com/fc/yaml/readme
+# 关于:
+# - Serverless Devs和FC组件的关系、如何声明/部署多个函数、超过50M的代码包如何部署
+# - 关于.fcignore使用方法、工具中.s目录是做什么、函数进行build操作之后如何处理build的产物
+# 等问题,可以参考文档:https://www.serverless-devs.com/fc/tips
+# 关于如何做CICD等问题,可以参考:https://www.serverless-devs.com/serverless-devs/cicd
+# 关于如何进行环境划分等问题,可以参考:https://www.serverless-devs.com/serverless-devs/extend
+# 更多函数计算案例,可参考:https://github.com/devsapp/awesome/
+# 有问题快来钉钉群问一下吧:33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access 是当前应用所需要的密钥信息配置:
+# 密钥配置可以参考:https://www.serverless-devs.com/serverless-devs/command/config
+# 密钥使用顺序可以参考:https://www.serverless-devs.com/serverless-devs/tool#密钥使用顺序与规范
+access: "{{ access }}"
+
+vars: # 全局变量
+ region: "{{ region }}"
+ service:
+ name: "{{ serviceName }}"
+ description: 'hello world by serverless devs'
+
+services:
+ helloworld: # 业务名称/模块名称
+ # 如果只想针对 helloworld 下面的业务进行相关操作,可以在命令行中加上 helloworld,例如:
+ # 只对helloworld进行构建:s helloworld build
+ # 如果不带有 helloworld ,而是直接执行 s build,工具则会对当前Yaml下,所有和 helloworld 平级的业务模块(如有其他平级的模块,例如下面注释的next-function),按照一定顺序进行 build 操作
+ component: fc # 组件名称,Serverless Devs 工具本身类似于一种游戏机,不具备具体的业务能力,组件类似于游戏卡,用户通过向游戏机中插入不同的游戏卡实现不同的功能,即通过使用不同的组件实现不同的具体业务能力
+ actions: # 自定义执行逻辑,关于actions 的使用,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#行为描述
+ pre-deploy: # 在deploy之前运行
+ - run: mvn package
+ path: ./
+# - component: fc build --use-docker --dockerfile ./code/Dockerfile # 要运行的组件,格式为【component: 组件名 命令 参数】(可以通过s cli registry search --type Component 获取组件列表)
+# - run: docker build xxx # 要执行的系统命令,类似于一种钩子的形式
+# path: ./src # 执行系统命令/钩子的路径
+# - plugin: myplugin # 与运行的插件 (可以通过s cli registry search --type Plugin 获取组件列表)
+# args: # 插件的参数信息
+# testKey: testValue
+# post-deploy: # 在deploy之后运行
+# - component: fc versions publish # 要运行的命令行
+ props:
+ region: ${vars.region} # 关于变量的使用方法,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#变量赋值
+ service: ${vars.service}
+ function:
+ name: "{{ functionName }}"
+ description: 'hello world by serverless devs'
+ runtime: java11
+ codeUri: ./target/HelloFCJava-1.0-SNAPSHOT-jar-with-dependencies.jar
+ handler: example.App::handleRequest
+ memorySize: 512
+ timeout: 60
+ initializationTimeout: 60
+ initializer: example.App::initialize
+# next-function: # 第二个函数的案例,仅供参考
+# # 如果在当前项目下执行 s deploy,会同时部署模块:
+# # helloworld:服务hello-world-service,函数cpp-event-function
+# # next-function:服务hello-world-service,函数next-function-example
+# # 如果想单独部署当前服务与函数,可以执行 s + 模块名/业务名 + deploy,例如:s next-function deploy
+# # 如果想单独部署当前函数,可以执行 s + 模块名/业务名 + deploy function,例如:s next-function deploy function
+# # 更多命令可参考:https://www.serverless-devs.com/fc/readme#文档相关
+# component: fc
+# props:
+# region: ${vars.region}
+# service: ${vars.service} # 应用整体的服务配置
+# function: # 定义一个新的函数
+# name: next-function-example
+# description: 'hello world by serverless devs'
\ No newline at end of file
diff --git a/event-function/fc-event-java11/src/s_en.yaml b/event-function/fc-event-java11/src/s_en.yaml
new file mode 100644
index 0000000..ace6896
--- /dev/null
+++ b/event-function/fc-event-java11/src/s_en.yaml
@@ -0,0 +1,74 @@
+# ------------------------------------
+# If you want to use this file directly, please add [-t/--template] parameter, for example [s deploy -t s_en.yaml]
+# ------------------------------------
+# Welcome to use Alibaba Cloud Function Compute FC components for project development
+# Component warehouse address: https://github.com/devsapp/fc
+# Component help documentation: https://www.serverless-devs.com/fc/readme
+# Yaml reference documentation: https://www.serverless-devs.com/fc/yaml/readme
+# About:
+# - The relationship between Serverless Devs and FC components, how to declare/deploy multiple functions, how to deploy code packages over 50M
+# - About the usage of .fcignore, what the .s directory in the tool does, and how to process the build product after the function performs the build operation
+# and other issues, you can refer to the documentation: https://www.serverless-devs.com/fc/tips
+# For questions about how to do CICD, please refer to: https://www.serverless-devs.com/serverless-devs/cicd
+# For issues such as how to divide the environment, please refer to: https://www.serverless-devs.com/serverless-devs/extend
+# For more function calculation cases, please refer to: https://github.com/devsapp/awesome/blob/main/README_en.md
+# If you have any questions, please come to the DingTalk group and ask: 33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access is the key information configuration required by the current application:
+# Key configuration can refer to: https://www.serverless-devs.com/serverless-devs/command/config
+# For the order of key usage, please refer to: https://www.serverless-devs.com/serverless-devs/tool#Key usage order and specification
+# access: "{{ access }}"
+
+vars: # global variables
+ region: cn-hangzhou
+ service:
+ name: hello-world-service
+ description: 'hello world by serverless devs'
+
+services:
+ helloworld: # business name/module name
+ # If you only want to perform related operations on the business below helloworld, you can add helloworld to the command line, for example:
+ # Build only helloworld: s helloworld build
+ # If s build is directly executed without helloworld, the tool will perform the same operation on all business modules at the same level as helloworld under the current Yaml (if there are other level modules, such as the next-function commented below), according to certain Sequential build operations
+ component: fc # The name of the component. The Serverless Devs tool itself is similar to a game console and does not have specific business capabilities. The component is similar to a game card. Users can achieve different functions by inserting different game cards into the game console, that is, by using Different components implement different specific business capabilities
+ actions: # Customize execution logic. For the use of actions, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Behavior description
+ pre-deploy: # run before deploy
+ - run: mvn package
+ path: ./
+# - component: fc build --use-docker --dockerfile ./code/Dockerfile # The component to run, the format is [component: component name command parameter] (you can get the component list through s cli registry search --type Component)
+# - run: docker build xxx # System command to execute, similar to a hook
+# path: ./src # The path to execute system commands/hooks
+# - plugin: myplugin # and running plugins (you can get a list of components via s cli registry search --type Plugin)
+# args: # parameter information of the plugin
+# testKey: testValue
+# post-deploy: # run after deploy
+# - component: fc versions publish # command line to run
+ props:
+ region: ${vars.region} # For the usage of variables, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Variable assignment
+ service: ${vars.service}
+ function:
+ name: custom-cpp-event-function
+ description: 'hello world by serverless devs'
+ runtime: java11
+ codeUri: ./target/HelloFCJava-1.0-SNAPSHOT-jar-with-dependencies.jar
+ handler: example.App::handleRequest
+ memorySize: 512
+ timeout: 60
+ initializationTimeout: 60
+ initializer: example.App::initialize
+# next-function: # The case of the second function, just for reference
+# # If you execute s deploy under the current project, the modules will be deployed at the same time:
+# # helloworld: service hello-world-service, function cpp-event-function
+# # next-function: service hello-world-service, function next-function-example
+# # If you want to deploy the current service and function separately, you can execute s + module name/business name + deploy, for example: s next-function deploy
+# # If you want to deploy the current function separately, you can execute s + module name/business name + deploy function, for example: s next-function deploy function
+# # For more commands, please refer to: https://www.serverless-devs.com/fc/readme#Document related
+# component: fc
+# props:
+# region: ${vars.region}
+# service: ${vars.service} # The overall service configuration of the application
+# function: # define a new function
+# name: next-function-example
+# description: 'hello world by serverless devs'
\ No newline at end of file
diff --git a/event-function/fc-event-java11/src/src/main/java/example/App.java b/event-function/fc-event-java11/src/src/main/java/example/App.java
new file mode 100644
index 0000000..5df5bca
--- /dev/null
+++ b/event-function/fc-event-java11/src/src/main/java/example/App.java
@@ -0,0 +1,26 @@
+package example;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import com.aliyun.fc.runtime.Context;
+import com.aliyun.fc.runtime.StreamRequestHandler;
+import com.aliyun.fc.runtime.FunctionInitializer;
+
+/**
+ * Hello world!
+ *
+ */
+public class App implements StreamRequestHandler, FunctionInitializer {
+
+ public void initialize(Context context) throws IOException {
+ //TODO
+ }
+
+ @Override
+ public void handleRequest(
+ InputStream inputStream, OutputStream outputStream, Context context) throws IOException {
+ outputStream.write(new String("hello world\n").getBytes());
+ }
+}
diff --git a/event-function/fc-event-java11/version.md b/event-function/fc-event-java11/version.md
new file mode 100644
index 0000000..b51e0aa
--- /dev/null
+++ b/event-function/fc-event-java11/version.md
@@ -0,0 +1 @@
+- 新版本支持
\ No newline at end of file
diff --git a/http-function/fc-http-java11/cloudshell.md b/http-function/fc-http-java11/cloudshell.md
new file mode 100644
index 0000000..0455f9c
--- /dev/null
+++ b/http-function/fc-http-java11/cloudshell.md
@@ -0,0 +1,68 @@
+# 快速体验 Java11 HTTP 函数案例
+
+欢迎您使用 Serverless Devs 开发者工具进行项目开发,本实验是基于 Serverless Devs 部署 Java11 HTTP 案例到阿里云函数计算。
+
+整个实验过程包括:
+
+- [下载工具](#下载工具)
+- [配置密钥](#配置密钥)
+- [初始化项目](#初始化项目)
+- [部署项目](#部署项目)
+- [更多信息](#更多信息)
+
+> - [:octocat: 源代码](https://github.com/devsapp/start-fc/tree/main/http-function/fc-http-java11/src)
+
+## 下载工具
+
+> 由于本系统已经默认集成了 Serverless Devs,所以该步骤在本次试验中可以跳过
+
+通过`npm`安装 Serverless Devs 开发者工具:
+
+```
+npm install -g @serverless-devs/s
+```
+
+除了上述的安装方法之外,您还可以参考[Serverless Devs Cli 安装文档](https://www.serverless-devs.com/serverless-devs/install) 查看更多安装方法。
+
+## 配置密钥
+
+> 由于本系统已经配置了密钥信息,所以该步骤在本次试验中可以跳过
+
+配置阿里云账号的 AccessKeyID, AccessKeySecret 以及密钥别名。
+
+配置方法可以通过`s config add`指令,选择`Alibaba Cloud`并根据提示进行配置。
+
+除了上述的配置方法之外,您还可以参考[Serverless Devs 配置阿里云密钥信息](https://www.serverless-devs.com/fc/config) 查看更多密钥配置方法。
+
+## 初始化项目
+
+进行项目初始化:
+
+```
+s init start-fc-http-java11 -d start-fc-http-java11
+```
+
+在初始化的过程中,可能涉及到部分服务的开通、参数的获取以及参数的定义,请根据命令行的提醒进行具体的操作。
+
+## 部署项目
+
+- 进入项目:`cd start-fc-http-java11`
+- 进行项目的部署:`s deploy`
+
+稍等片刻,即可完成项目的部署。
+
+## 更多信息
+
+- 组件仓库地址:https://github.com/devsapp/fc
+- 组件帮助文档:https://www.serverless-devs.com/fc/readme
+- Yaml 参考文档:https://www.serverless-devs.com/fc/yaml/readme
+- 关于:
+ - Serverless Devs 和 FC 组件的关系、如何声明/部署多个函数、超过 50M 的代码包如何部署
+ - 关于.fcignore 使用方法、工具中.s 目录是做什么、函数进行 build 操作之后如何处理 build 的产物
+ 等问题,可以参考文档:https://www.serverless-devs.com/fc/tips
+- 关于如何做 CICD 等问题,可以参考:https://www.serverless-devs.com/serverless-devs/cicd
+- 关于如何进行环境划分等问题,可以参考:https://www.serverless-devs.com/serverless-devs/extend
+
+更多函数计算案例,可参考:https://github.com/devsapp/awesome/
+
+> 有问题快来钉钉群问一下吧:33947367
diff --git a/http-function/fc-http-java11/hook/index.js b/http-function/fc-http-java11/hook/index.js
new file mode 100644
index 0000000..f588568
--- /dev/null
+++ b/http-function/fc-http-java11/hook/index.js
@@ -0,0 +1,24 @@
+async function preInit(inputObj) {
+ console.log(`
+ Serverless Devs Application Case
+
+ Cloud services required:
+ - FC : https://fc.console.aliyun.com/
+
+ Tips:
+ - FC Component: https://www.serverless-devs.com/fc/readme`)
+
+}
+
+async function postInit(inputObj) {
+ console.log(`
+ * Before using, please check whether the actions command in Yaml file is available
+ * Carefully reading the notes in s.yaml is helpful for the use of the tool
+ * If need help in the use process, please apply to join the Dingtalk Group: 33947367
+ `)
+}
+
+module.exports = {
+ postInit,
+ preInit
+}
diff --git a/http-function/fc-http-java11/publish.yaml b/http-function/fc-http-java11/publish.yaml
new file mode 100644
index 0000000..945a196
--- /dev/null
+++ b/http-function/fc-http-java11/publish.yaml
@@ -0,0 +1,60 @@
+Type: Application
+Name: start-fc-http-java11
+Version: 0.0.1
+Provider:
+ - 阿里云
+Description: 快速部署一个 Java 8 的 HTTP 类型的 Hello World 函数到阿里云函数计算。
+HomePage: https://github.com/devsapp/start-fc
+Tags:
+ - 函数计算
+ - 你好世界
+ - 新手入门
+Category: 新手入门
+Service:
+ 函数计算:
+ Authorities:
+ - AliyunFCFullAccess
+ Runtime: Java11
+Parameters:
+ type: object
+ additionalProperties: false # 不允许增加其他属性
+ required: # 必填项
+ - region
+ - serviceName
+ - functionName
+ properties:
+ region:
+ title: 地域
+ type: string
+ default: cn-hangzhou
+ description: 创建应用所在的地区
+ enum:
+ - cn-beijing
+ - cn-hangzhou
+ - cn-shanghai
+ - cn-qingdao
+ - cn-zhangjiakou
+ - cn-huhehaote
+ - cn-shenzhen
+ - cn-chengdu
+ - cn-hongkong
+ - ap-southeast-1
+ - ap-southeast-2
+ - ap-southeast-3
+ - ap-southeast-5
+ - ap-northeast-1
+ - eu-central-1
+ - eu-west-1
+ - us-west-1
+ - us-east-1
+ - ap-south-1
+ serviceName:
+ title: 服务名
+ type: string
+ default: hello-world-service
+ description: 服务名称,只能包含字母、数字、下划线和中划线。不能以数字、中划线开头。长度在 1-128 之间
+ functionName:
+ title: 函数名
+ type: string
+ default: start-fc-http-java11
+ description: 函数名称,只能包含字母、数字、下划线和中划线。不能以数字、中划线开头。长度在 1-64 之间
\ No newline at end of file
diff --git a/http-function/fc-http-java11/readme.md b/http-function/fc-http-java11/readme.md
new file mode 100644
index 0000000..ca616d3
--- /dev/null
+++ b/http-function/fc-http-java11/readme.md
@@ -0,0 +1,81 @@
+# start-fc-http-java11 帮助文档
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+快速部署一个 Java 11 的 HTTP 类型的 Hello World 函数到阿里云函数计算。
+
+
+
+
+
+## 前期准备
+
+使用该项目,推荐您拥有以下的产品权限 / 策略:
+
+| 服务/业务 | 函数计算 |
+| --------- | ------------------ |
+| 权限/策略 | AliyunFCFullAccess |
+
+
+
+
+
+# 代码 & 预览
+
+- [ :smiley_cat: 源代码](https://github.com/devsapp/start-fc/blob/main/http-function/fc-http-java11)
+
+
+
+
+
+## 部署 & 体验
+
+
+
+- :fire: 通过 [Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-fc-http-java11) ,
+ [![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-fc-http-java11) 该应用。
+
+
+
+- 通过 [Serverless Devs Cli](https://www.serverless-devs.com/serverless-devs/install) 进行部署:
+ - [安装 Serverless Devs Cli 开发者工具](https://www.serverless-devs.com/serverless-devs/install) ,并进行[授权信息配置](https://www.serverless-devs.com/fc/config) ;
+ - 初始化项目:`s init start-fc-http-java11 -d start-fc-http-java11`
+ - 进入项目,并进行项目部署:`cd start-fc-http-java11 && s deploy -y`
+
+
+
+
+
+# 应用详情
+
+本应用仅作为学习和参考使用,您可以基于本项目进行二次开发和完善,实现自己的业务逻辑
+
+
+
+
+
+## 开发者社区
+
+您如果有关于错误的反馈或者未来的期待,您可以在 [Serverless Devs repo Issues](https://github.com/serverless-devs/serverless-devs/issues) 中进行反馈和交流。如果您想要加入我们的讨论组或者了解 FC 组件的最新动态,您可以通过以下渠道进行:
+
+
+
+| | | |
+| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
+|
微信公众号:`serverless` | 微信小助手:`xiaojiangwh` | 钉钉交流群:`33947367` |
+
+
+
+
diff --git a/http-function/fc-http-java11/src/pom.xml b/http-function/fc-http-java11/src/pom.xml
new file mode 100644
index 0000000..9ed86a1
--- /dev/null
+++ b/http-function/fc-http-java11/src/pom.xml
@@ -0,0 +1,50 @@
+
+ 4.0.0
+ example
+ HelloFCJava
+ jar
+ 1.0-SNAPSHOT
+ HelloFCJava
+
+
+
+ junit
+ junit
+ 3.8.1
+ test
+
+
+ com.aliyun.fc.runtime
+ fc-java-core
+ 1.3.0
+
+
+
+
+
+
+ maven-assembly-plugin
+
+
+ jar-with-dependencies
+
+
+
+
+ make-my-jar-with-dependencies
+ package
+
+ single
+
+
+
+
+
+
+
+
+ 11
+ true
+
+
diff --git a/http-function/fc-http-java11/src/readme.md b/http-function/fc-http-java11/src/readme.md
new file mode 100644
index 0000000..ca616d3
--- /dev/null
+++ b/http-function/fc-http-java11/src/readme.md
@@ -0,0 +1,81 @@
+# start-fc-http-java11 帮助文档
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+快速部署一个 Java 11 的 HTTP 类型的 Hello World 函数到阿里云函数计算。
+
+
+
+
+
+## 前期准备
+
+使用该项目,推荐您拥有以下的产品权限 / 策略:
+
+| 服务/业务 | 函数计算 |
+| --------- | ------------------ |
+| 权限/策略 | AliyunFCFullAccess |
+
+
+
+
+
+# 代码 & 预览
+
+- [ :smiley_cat: 源代码](https://github.com/devsapp/start-fc/blob/main/http-function/fc-http-java11)
+
+
+
+
+
+## 部署 & 体验
+
+
+
+- :fire: 通过 [Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-fc-http-java11) ,
+ [![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-fc-http-java11) 该应用。
+
+
+
+- 通过 [Serverless Devs Cli](https://www.serverless-devs.com/serverless-devs/install) 进行部署:
+ - [安装 Serverless Devs Cli 开发者工具](https://www.serverless-devs.com/serverless-devs/install) ,并进行[授权信息配置](https://www.serverless-devs.com/fc/config) ;
+ - 初始化项目:`s init start-fc-http-java11 -d start-fc-http-java11`
+ - 进入项目,并进行项目部署:`cd start-fc-http-java11 && s deploy -y`
+
+
+
+
+
+# 应用详情
+
+本应用仅作为学习和参考使用,您可以基于本项目进行二次开发和完善,实现自己的业务逻辑
+
+
+
+
+
+## 开发者社区
+
+您如果有关于错误的反馈或者未来的期待,您可以在 [Serverless Devs repo Issues](https://github.com/serverless-devs/serverless-devs/issues) 中进行反馈和交流。如果您想要加入我们的讨论组或者了解 FC 组件的最新动态,您可以通过以下渠道进行:
+
+
+
+| | | |
+| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
+|
微信公众号:`serverless` | 微信小助手:`xiaojiangwh` | 钉钉交流群:`33947367` |
+
+
+
+
diff --git a/http-function/fc-http-java11/src/s.yaml b/http-function/fc-http-java11/src/s.yaml
new file mode 100644
index 0000000..e8af5a9
--- /dev/null
+++ b/http-function/fc-http-java11/src/s.yaml
@@ -0,0 +1,90 @@
+# ------------------------------------
+# If you need English case, you can refer to [s_en.yaml] file
+# ------------------------------------
+# 欢迎您使用阿里云函数计算 FC 组件进行项目开发
+# 组件仓库地址:https://github.com/devsapp/fc
+# 组件帮助文档:https://www.serverless-devs.com/fc/readme
+# Yaml参考文档:https://www.serverless-devs.com/fc/yaml/readme
+# 关于:
+# - Serverless Devs和FC组件的关系、如何声明/部署多个函数、超过50M的代码包如何部署
+# - 关于.fcignore使用方法、工具中.s目录是做什么、函数进行build操作之后如何处理build的产物
+# 等问题,可以参考文档:https://www.serverless-devs.com/fc/tips
+# 关于如何做CICD等问题,可以参考:https://www.serverless-devs.com/serverless-devs/cicd
+# 关于如何进行环境划分等问题,可以参考:https://www.serverless-devs.com/serverless-devs/extend
+# 更多函数计算案例,可参考:https://github.com/devsapp/awesome/
+# 有问题快来钉钉群问一下吧:33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access 是当前应用所需要的密钥信息配置:
+# 密钥配置可以参考:https://www.serverless-devs.com/serverless-devs/command/config
+# 密钥使用顺序可以参考:https://www.serverless-devs.com/serverless-devs/tool#密钥使用顺序与规范
+access: "{{ access }}"
+
+vars: # 全局变量
+ region: "{{ region }}"
+ service:
+ name: "{{ serviceName }}"
+ description: 'hello world by serverless devs'
+
+services:
+ helloworld: # 业务名称/模块名称
+ # 如果只想针对 helloworld 下面的业务进行相关操作,可以在命令行中加上 helloworld,例如:
+ # 只对helloworld进行构建:s helloworld build
+ # 如果不带有 helloworld ,而是直接执行 s build,工具则会对当前Yaml下,所有和 helloworld 平级的业务模块(如有其他平级的模块,例如下面注释的next-function),按照一定顺序进行 build 操作
+ component: fc # 组件名称,Serverless Devs 工具本身类似于一种游戏机,不具备具体的业务能力,组件类似于游戏卡,用户通过向游戏机中插入不同的游戏卡实现不同的功能,即通过使用不同的组件实现不同的具体业务能力
+ actions: # 自定义执行逻辑,关于actions 的使用,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#行为描述
+ pre-deploy: # 在deploy之前运行
+ - run: mvn package
+ path: ./
+# - component: fc build --use-docker --dockerfile ./code/Dockerfile # 要运行的组件,格式为【component: 组件名 命令 参数】(可以通过s cli registry search --type Component 获取组件列表)
+# - run: docker build xxx # 要执行的系统命令,类似于一种钩子的形式
+# path: ./src # 执行系统命令/钩子的路径
+# - plugin: myplugin # 与运行的插件 (可以通过s cli registry search --type Plugin 获取组件列表)
+# args: # 插件的参数信息
+# testKey: testValue
+# post-deploy: # 在deploy之后运行
+# - component: fc versions publish # 要运行的命令行
+ props:
+ region: ${vars.region} # 关于变量的使用方法,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#变量赋值
+ service: ${vars.service}
+ function:
+ name: "{{ functionName }}"
+ description: 'hello world by serverless devs'
+ runtime: java11
+ codeUri: ./target/HelloFCJava-1.0-SNAPSHOT-jar-with-dependencies.jar
+ handler: example.App::handleRequest
+ memorySize: 512
+ timeout: 60
+ initializationTimeout: 60
+ initializer: example.App::initialize
+ triggers:
+ - name: httpTrigger
+ type: http
+ config:
+ authType: anonymous
+ methods:
+ - GET
+ customDomains:
+ - domainName: auto
+ protocol: HTTP
+ routeConfigs:
+ - path: /*
+ methods:
+ - GET
+ - POST
+
+# next-function: # 第二个函数的案例,仅供参考
+# # 如果在当前项目下执行 s deploy,会同时部署模块:
+# # helloworld:服务hello-world-service,函数cpp-event-function
+# # next-function:服务hello-world-service,函数next-function-example
+# # 如果想单独部署当前服务与函数,可以执行 s + 模块名/业务名 + deploy,例如:s next-function deploy
+# # 如果想单独部署当前函数,可以执行 s + 模块名/业务名 + deploy function,例如:s next-function deploy function
+# # 更多命令可参考:https://www.serverless-devs.com/fc/readme#文档相关
+# component: fc
+# props:
+# region: ${vars.region}
+# service: ${vars.service} # 应用整体的服务配置
+# function: # 定义一个新的函数
+# name: next-function-example
+# description: 'hello world by serverless devs'
\ No newline at end of file
diff --git a/http-function/fc-http-java11/src/s_en.yaml b/http-function/fc-http-java11/src/s_en.yaml
new file mode 100644
index 0000000..6222025
--- /dev/null
+++ b/http-function/fc-http-java11/src/s_en.yaml
@@ -0,0 +1,89 @@
+# ------------------------------------
+# If you want to use this file directly, please add [-t/--template] parameter, for example [s deploy -t s_en.yaml]
+# ------------------------------------
+# Welcome to use Alibaba Cloud Function Compute FC components for project development
+# Component warehouse address: https://github.com/devsapp/fc
+# Component help documentation: https://www.serverless-devs.com/fc/readme
+# Yaml reference documentation: https://www.serverless-devs.com/fc/yaml/readme
+# About:
+# - The relationship between Serverless Devs and FC components, how to declare/deploy multiple functions, how to deploy code packages over 50M
+# - About the usage of .fcignore, what the .s directory in the tool does, and how to process the build product after the function performs the build operation
+# and other issues, you can refer to the documentation: https://www.serverless-devs.com/fc/tips
+# For questions about how to do CICD, please refer to: https://www.serverless-devs.com/serverless-devs/cicd
+# For issues such as how to divide the environment, please refer to: https://www.serverless-devs.com/serverless-devs/extend
+# For more function calculation cases, please refer to: https://github.com/devsapp/awesome/blob/main/README_en.md
+# If you have any questions, please come to the DingTalk group and ask: 33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access is the key information configuration required by the current application:
+# Key configuration can refer to: https://www.serverless-devs.com/serverless-devs/command/config
+# For the order of key usage, please refer to: https://www.serverless-devs.com/serverless-devs/tool#Key usage order and specification
+# access: "{{ access }}"
+
+vars: # global variables
+ region: cn-hangzhou
+ service:
+ name: hello-world-service
+ description: 'hello world by serverless devs'
+
+services:
+ helloworld: # business name/module name
+ # If you only want to perform related operations on the business below helloworld, you can add helloworld to the command line, for example:
+ # Build only helloworld: s helloworld build
+ # If s build is directly executed without helloworld, the tool will perform the same operation on all business modules at the same level as helloworld under the current Yaml (if there are other level modules, such as the next-function commented below), according to certain Sequential build operations
+ component: fc # The name of the component. The Serverless Devs tool itself is similar to a game console and does not have specific business capabilities. The component is similar to a game card. Users can achieve different functions by inserting different game cards into the game console, that is, by using Different components implement different specific business capabilities
+ actions: # Customize execution logic. For the use of actions, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Behavior description
+ pre-deploy: # run before deploy
+ - run: mvn package
+ path: ./
+# - component: fc build --use-docker --dockerfile ./code/Dockerfile # The component to run, the format is [component: component name command parameter] (you can get the component list through s cli registry search --type Component)
+# - run: docker build xxx # System command to execute, similar to a hook
+# path: ./src # The path to execute system commands/hooks
+# - plugin: myplugin # and running plugins (you can get a list of components via s cli registry search --type Plugin)
+# args: # parameter information of the plugin
+# testKey: testValue
+# post-deploy: # run after deploy
+# - component: fc versions publish # command line to run
+ props:
+ region: ${vars.region} # For the usage of variables, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Variable assignment
+ service: ${vars.service}
+ function:
+ name: custom-cpp-event-function
+ description: 'hello world by serverless devs'
+ runtime: java11
+ codeUri: ./target/HelloFCJava-1.0-SNAPSHOT-jar-with-dependencies.jar
+ handler: example.App::handleRequest
+ memorySize: 512
+ timeout: 60
+ initializationTimeout: 60
+ initializer: example.App::initialize
+ triggers:
+ - name: httpTrigger
+ type: http
+ config:
+ authType: anonymous
+ methods:
+ - GET
+ customDomains:
+ - domainName: auto
+ protocol: HTTP
+ routeConfigs:
+ - path: /*
+ methods:
+ - GET
+ - POST
+# next-function: # The case of the second function, just for reference
+# # If you execute s deploy under the current project, the modules will be deployed at the same time:
+# # helloworld: service hello-world-service, function cpp-event-function
+# # next-function: service hello-world-service, function next-function-example
+# # If you want to deploy the current service and function separately, you can execute s + module name/business name + deploy, for example: s next-function deploy
+# # If you want to deploy the current function separately, you can execute s + module name/business name + deploy function, for example: s next-function deploy function
+# # For more commands, please refer to: https://www.serverless-devs.com/fc/readme#Document related
+# component: fc
+# props:
+# region: ${vars.region}
+# service: ${vars.service} # The overall service configuration of the application
+# function: # define a new function
+# name: next-function-example
+# description: 'hello world by serverless devs'
\ No newline at end of file
diff --git a/http-function/fc-http-java11/src/src/main/java/example/App.java b/http-function/fc-http-java11/src/src/main/java/example/App.java
new file mode 100644
index 0000000..3e6a382
--- /dev/null
+++ b/http-function/fc-http-java11/src/src/main/java/example/App.java
@@ -0,0 +1,41 @@
+package example;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import javax.servlet.ServletException;
+
+import com.aliyun.fc.runtime.Context;
+import com.aliyun.fc.runtime.FunctionInitializer;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import com.aliyun.fc.runtime.HttpRequestHandler;
+
+/**
+ * Hello world!
+ *
+ */
+public class App implements HttpRequestHandler, FunctionInitializer {
+
+ public void initialize(Context context) throws IOException {
+ //TODO
+ }
+
+ @Override
+ public void handleRequest(HttpServletRequest request, HttpServletResponse response, Context context)
+ throws IOException, ServletException {
+ String requestPath = (String) request.getAttribute("FC_REQUEST_PATH");
+ String requestURI = (String) request.getAttribute("FC_REQUEST_URI");
+ String requestClientIP = (String) request.getAttribute("FC_REQUEST_CLIENT_IP");
+
+ response.setStatus(200);
+ response.setHeader("header1", "value1");
+ response.setHeader("header2", "value2");
+ response.setHeader("Content-Type", "text/plain");
+
+ String body = String.format("Path: %s\n Uri: %s\n IP: %s\n", requestPath, requestURI, requestClientIP);
+ OutputStream out = response.getOutputStream();
+ out.write((body).getBytes());
+ out.flush();
+ out.close();
+ }
+}
diff --git a/http-function/fc-http-java11/version.md b/http-function/fc-http-java11/version.md
new file mode 100644
index 0000000..b51e0aa
--- /dev/null
+++ b/http-function/fc-http-java11/version.md
@@ -0,0 +1 @@
+- 新版本支持
\ No newline at end of file
diff --git a/readme.md b/readme.md
index 8078d0d..eb225c4 100644
--- a/readme.md
+++ b/readme.md
@@ -14,7 +14,7 @@
## 包含内容
-- Event函数(事件函数)
+- Event 函数(事件函数)
- [fc-event-node.js6](event-function/fc-event-node.js6/src):`s init start-fc-event-nodejs6`
- [fc-event-node.js8](event-function/fc-event-node.js8/src):`s init start-fc-event-nodejs8`
- [fc-event-node.js10](event-function/fc-event-node.js10/src):`s init start-fc-event-nodejs10`
@@ -23,8 +23,9 @@
- [fc-event-python2.7](event-function/fc-event-python2.7/src):`s init start-fc-event-python2`
- [fc-event-python3.6](event-function/fc-event-python3.6/src):`s init start-fc-event-python3`
- [fc-event-java8](event-function/fc-event-java8/src):`s init start-fc-event-java8`
+ - [fc-event-java11](event-function/fc-event-java11/src):`s init start-fc-event-java11`
- [fc-event-golang1.x](event-function/fc-event-golang1.x/src):`s init start-fc-event-golang1.x`
-- HTTP函数
+- HTTP 函数
- [fc-http-node.js6](http-function/fc-http-node.js6/src):`s init start-fc-http-nodejs6`
- [fc-http-node.js8](http-function/fc-http-node.js8/src):`s init start-fc-http-nodejs8`
- [fc-http-node.js10](http-function/fc-http-node.js10/src):`s init start-fc-http-nodejs10`
@@ -33,28 +34,29 @@
- [fc-http-python2.7](http-function/fc-http-python2.7/src):`s init start-fc-http-python2`
- [fc-http-python3.6](http-function/fc-http-python3.6/src):`s init start-fc-http-python3`
- [fc-http-java8](http-function/fc-http-java8/src):`s init start-fc-http-java8`
+ - [fc-http-java11](http-function/fc-http-java11/src):`s init start-fc-http-java11`
- [fc-http-golang1.x](http-function/fc-http-golang1.x/src):`s init start-fc-http-golang1.x`
-- Custom案例(自定义运行时)
- - Golang
- - Event函数(事件函数) [fc-custom-golang-event](custom-function/golang/fc-custom-golang-event/src):`s init fc-custom-golang-event`
- - Websocket案例 [fc-custom-golang-websocket](custom-function/golang/fc-custom-golang-websocket/src):`s init fc-custom-golang-websocket`
+- Custom 案例(自定义运行时)
+ - Golang
+ - Event 函数(事件函数) [fc-custom-golang-event](custom-function/golang/fc-custom-golang-event/src):`s init fc-custom-golang-event`
+ - Websocket 案例 [fc-custom-golang-websocket](custom-function/golang/fc-custom-golang-websocket/src):`s init fc-custom-golang-websocket`
- Grpc 案例 [fc-custom-golang-grpc](custom-function/golang/fc-custom-golang-grpc/src):`s init fc-custom-golang-grpc`
- - Nodejs10
- - Event函数(事件函数) [fc-custom-nodejs10-event](custom-function/nodejs10/fc-custom-nodejs10-event/src):`s init fc-custom-nodejs10-event`
- - Websocket案例 [fc-custom-nodejs10-websocket](custom-function/nodejs10/fc-custom-nodejs10-websocket/src):`s init fc-custom-nodejs10-websocket`
- - Nodejs12
- - Event函数(事件函数) [fc-custom-nodejs12-event](custom-function/nodejs12/fc-custom-nodejs12-event/src):`s init fc-custom-nodejs12-event`
- - Websocket案例 [fc-custom-nodejs12-websocket](custom-function/nodejs12/fc-custom-nodejs12-websocket/src):`s init fc-custom-nodejs12-websocket`
- - PHP74-Swoole
- - Event函数(事件函数) [fc-custom-php74-event](custom-function/php74/fc-custom-php74-event/src):`s init fc-custom-php74-event`
- - HTTP函数 [fc-custom-php74-http](custom-function/php74/fc-custom-php74-http/src):`s init fc-custom-php74-http`
- - Python37
- - Event函数(事件函数) [fc-custom-python37-event](custom-function/python37/fc-custom-python37-event/src):`s init fc-custom-python37-event`
- - HTTP函数 [fc-custom-python37-http](custom-function/python37/fc-custom-python37-http/src):`s init fc-custom-python37-http`
- - Webscoket案例 [fc-custom-python37-websocket](custom-function/python37/fc-custom-python37-websocket/src):`s init fc-custom-python37-websocket`
+ - Nodejs10
+ - Event 函数(事件函数) [fc-custom-nodejs10-event](custom-function/nodejs10/fc-custom-nodejs10-event/src):`s init fc-custom-nodejs10-event`
+ - Websocket 案例 [fc-custom-nodejs10-websocket](custom-function/nodejs10/fc-custom-nodejs10-websocket/src):`s init fc-custom-nodejs10-websocket`
+ - Nodejs12
+ - Event 函数(事件函数) [fc-custom-nodejs12-event](custom-function/nodejs12/fc-custom-nodejs12-event/src):`s init fc-custom-nodejs12-event`
+ - Websocket 案例 [fc-custom-nodejs12-websocket](custom-function/nodejs12/fc-custom-nodejs12-websocket/src):`s init fc-custom-nodejs12-websocket`
+ - PHP74-Swoole
+ - Event 函数(事件函数) [fc-custom-php74-event](custom-function/php74/fc-custom-php74-event/src):`s init fc-custom-php74-event`
+ - HTTP 函数 [fc-custom-php74-http](custom-function/php74/fc-custom-php74-http/src):`s init fc-custom-php74-http`
+ - Python37
+ - Event 函数(事件函数) [fc-custom-python37-event](custom-function/python37/fc-custom-python37-event/src):`s init fc-custom-python37-event`
+ - HTTP 函数 [fc-custom-python37-http](custom-function/python37/fc-custom-python37-http/src):`s init fc-custom-python37-http`
+ - Webscoket 案例 [fc-custom-python37-websocket](custom-function/python37/fc-custom-python37-websocket/src):`s init fc-custom-python37-websocket`
- C++
- - Event函数(事件函数) [fc-custom-cpp-event](custom-function/cpp/fc-custom-cpp-event/src):`s init fc-custom-cpp-event`
- - HTTP函数 [fc-custom-cpp-http](custom-function/cpp/fc-custom-cpp-http/src):`s init fc-custom-cpp-http`
+ - Event 函数(事件函数) [fc-custom-cpp-event](custom-function/cpp/fc-custom-cpp-event/src):`s init fc-custom-cpp-event`
+ - HTTP 函数 [fc-custom-cpp-http](custom-function/cpp/fc-custom-cpp-http/src):`s init fc-custom-cpp-http`
- Java8-SpringBoot [fc-custom-java8-http](custom-function/java8/fc-custom-java8-http/src):`s init fc-custom-java8-http`
- Ruby [fc-custom-ruby-event](custom-function/ruby/fc-custom-ruby-event/src):`s init fc-custom-ruby-event`
- Powershell [fc-custom-powershell-event](custom-function/powershell/fc-custom-powershell-event/src):`s init fc-custom-powershell-event`
@@ -63,24 +65,24 @@
- Lua [fc-custom-lua-event](custom-function/lua/fc-custom-lua-event/src):`s init fc-custom-lua-event`
- Dart [fc-custom-dart-event](custom-function/dart/fc-custom-dart-event/src):`s init fc-custom-dart-event`
- Rust [fc-custom-rust-event](custom-function/rust/fc-custom-rust-event/src):`s init fc-custom-rust-event`
-- Custom Container案例(自定义容器镜像运行时)
- - Event函数(事件函数)
- - [fc-custom-container-event-cpp](custom-container-function/fc-custom-container-event-cpp/src):`s init start-fc-custom-container-event-cpp`
- - [fc-custom-container-event-nodejs14](custom-container-function/fc-custom-container-event-nodejs14/src):`s init start-fc-custom-container-event-nodejs14`
- - [fc-custom-container-event-python3.9](custom-container-function/fc-custom-container-event-python3.9/src):`s init start-fc-custom-container-event-python3.9`
- - HTTP函数
- - [fc-custom-container-http-cpp](custom-container-function/fc-custom-container-http-cpp/src):`s init start-fc-custom-container-http-cpp`
- - [fc-custom-container-http-springboot](custom-container-function/fc-custom-container-http-springboot/src):`s init start-fc-custom-container-http-springboot`
- - [fc-custom-container-http-aspdotnetcore](custom-container-function/fc-custom-container-http-aspdotnetcore/src):`s init start-fc-custom-container-http-aspdotnetcore`
- - Websocket案例
- - [fc-custom-container-websocket-golang](custom-container-function/fc-custom-container-websocket-golang/src):`s init start-fc-custom-container-websocket-golang`
- - [fc-custom-container-websocket-nodejs14](custom-container-function/fc-custom-container-websocket-nodejs14/src):`s init start-fc-custom-container-websocket-nodejs14`
- - [fc-custom-container-websocket-python3.9](custom-container-function/fc-custom-container-websocket-python3.9/src):`s init start-fc-custom-container-websocket-python3.9`
- - Grpc案例
- - [fc-custom-container-grpc-golang](custom-container-function/fc-custom-container-grpc-golang/src):`s init start-grpc-custom-container-grpc-golang`
- - 无Web Server函数
- - [fc-custom-container-no-web-server-event-env](custom-container-function/fc-custom-container-no-web-server-event-env)
- - [fc-custom-container-no-web-server-event-fibonacci](custom-container-function/fc-custom-container-no-web-server-event-fibonacci)
+- Custom Container 案例(自定义容器镜像运行时)
+ - Event 函数(事件函数)
+ - [fc-custom-container-event-cpp](custom-container-function/fc-custom-container-event-cpp/src):`s init start-fc-custom-container-event-cpp`
+ - [fc-custom-container-event-nodejs14](custom-container-function/fc-custom-container-event-nodejs14/src):`s init start-fc-custom-container-event-nodejs14`
+ - [fc-custom-container-event-python3.9](custom-container-function/fc-custom-container-event-python3.9/src):`s init start-fc-custom-container-event-python3.9`
+ - HTTP 函数
+ - [fc-custom-container-http-cpp](custom-container-function/fc-custom-container-http-cpp/src):`s init start-fc-custom-container-http-cpp`
+ - [fc-custom-container-http-springboot](custom-container-function/fc-custom-container-http-springboot/src):`s init start-fc-custom-container-http-springboot`
+ - [fc-custom-container-http-aspdotnetcore](custom-container-function/fc-custom-container-http-aspdotnetcore/src):`s init start-fc-custom-container-http-aspdotnetcore`
+ - Websocket 案例
+ - [fc-custom-container-websocket-golang](custom-container-function/fc-custom-container-websocket-golang/src):`s init start-fc-custom-container-websocket-golang`
+ - [fc-custom-container-websocket-nodejs14](custom-container-function/fc-custom-container-websocket-nodejs14/src):`s init start-fc-custom-container-websocket-nodejs14`
+ - [fc-custom-container-websocket-python3.9](custom-container-function/fc-custom-container-websocket-python3.9/src):`s init start-fc-custom-container-websocket-python3.9`
+ - Grpc 案例
+ - [fc-custom-container-grpc-golang](custom-container-function/fc-custom-container-grpc-golang/src):`s init start-grpc-custom-container-grpc-golang`
+ - 无 Web Server 函数
+ - [fc-custom-container-no-web-server-event-env](custom-container-function/fc-custom-container-no-web-server-event-env)
+ - [fc-custom-container-no-web-server-event-fibonacci](custom-container-function/fc-custom-container-no-web-server-event-fibonacci)
- 任务
- [Python3](async-task/python3/src):`s init start-async-task-python3`
diff --git a/update.list b/update.list
index 65b330c..84d9f6a 100644
--- a/update.list
+++ b/update.list
@@ -1,2 +1,2 @@
-custom-function/golang/fc-custom-golang-grpc
-custom-function/golang/fc-custom-golang-websocket
+event-function/fc-event-java11
+http-function/fc-http-java11
\ No newline at end of file