From 51a35a536cb51c58b08759fbd23336201809d178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=B5=E8=BD=AE?= Date: Mon, 1 Jul 2024 10:55:15 +0800 Subject: [PATCH 1/2] Fix nginx demo issue --- web-framework/nginx-reverse-proxy/publish.yaml | 2 +- web-framework/nginx-reverse-proxy/src/code/start.sh | 5 ++--- web-framework/nginx/publish.yaml | 2 +- web-framework/nginx/src/code/nginx.conf | 2 +- web-framework/nginx/src/s.yaml | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/web-framework/nginx-reverse-proxy/publish.yaml b/web-framework/nginx-reverse-proxy/publish.yaml index 4884bc94a..39f5fcd8a 100755 --- a/web-framework/nginx-reverse-proxy/publish.yaml +++ b/web-framework/nginx-reverse-proxy/publish.yaml @@ -1,7 +1,7 @@ Edition: 3.0.0 Type: Project Name: nginx-reverse-proxy -Version: 0.0.8 +Version: 0.0.9 Provider: - 阿里云 Description: 本案例快速部署一个 Nginx 项目到阿里云函数计算 FC。 diff --git a/web-framework/nginx-reverse-proxy/src/code/start.sh b/web-framework/nginx-reverse-proxy/src/code/start.sh index ab4348113..f50b16c9f 100755 --- a/web-framework/nginx-reverse-proxy/src/code/start.sh +++ b/web-framework/nginx-reverse-proxy/src/code/start.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -sed -i 's\${PROXY_PASS}\'$PROXY_PASS'\g' ./nginx.conf -nginx -c /code/nginx.conf -g "daemon off;" - +sed -i 's\${PROXY_PASS}\'$PROXY_PASS'\g' ./nginx.conf +/opt/bin/nginx -c /code/nginx.conf -g "daemon off;" diff --git a/web-framework/nginx/publish.yaml b/web-framework/nginx/publish.yaml index 9eb8f1507..3868ec9e8 100755 --- a/web-framework/nginx/publish.yaml +++ b/web-framework/nginx/publish.yaml @@ -1,7 +1,7 @@ Edition: 3.0.0 Type: Project Name: start-nginx-v3 -Version: 0.0.12 +Version: 0.0.13 Provider: - 阿里云 Description: 本案例快速部署一个 Nginx 项目到阿里云函数计算 FC。 diff --git a/web-framework/nginx/src/code/nginx.conf b/web-framework/nginx/src/code/nginx.conf index 571c633e7..f2aab25a2 100755 --- a/web-framework/nginx/src/code/nginx.conf +++ b/web-framework/nginx/src/code/nginx.conf @@ -1,4 +1,4 @@ -# nginx -c /code/nginx.conf -g 'daemon off;' +# /opt/bin/nginx -c /code/nginx.conf -g 'daemon off;' events { worker_connections 1024; } http { diff --git a/web-framework/nginx/src/s.yaml b/web-framework/nginx/src/s.yaml index c75491632..94ab5b669 100644 --- a/web-framework/nginx/src/s.yaml +++ b/web-framework/nginx/src/s.yaml @@ -24,7 +24,7 @@ resources: instanceConcurrency: 100 customRuntimeConfig: command: - - nginx + - "/opt/bin/nginx" - "-c" - "/code/nginx.conf" - "-g" From 2fb39516f160d3bc87056b475ac101d1c1d48694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=B5=E8=BD=AE?= Date: Mon, 1 Jul 2024 12:02:06 +0800 Subject: [PATCH 2/2] Fix typo --- web-framework/nodejs/express/publish.yaml | 2 +- web-framework/nodejs/express/src/code/index.js | 2 +- web-framework/nodejs/fastify/publish.yaml | 2 +- web-framework/nodejs/fastify/src/code/index.js | 2 +- web-framework/python/flask/publish.yaml | 2 +- web-framework/python/flask/src/code/index.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web-framework/nodejs/express/publish.yaml b/web-framework/nodejs/express/publish.yaml index 48588b1a9..5c1ae27fe 100755 --- a/web-framework/nodejs/express/publish.yaml +++ b/web-framework/nodejs/express/publish.yaml @@ -1,7 +1,7 @@ Edition: 3.0.0 Type: Project Name: start-express-v3 -Version: 0.0.14 +Version: 0.0.15 Provider: - 阿里云 Description: 本案例是将 Express 框架,这一基于 Node.js 平台的极简且灵活的 web 应用开发框架,快速创建并部署到阿里云函数计算 FC 。 diff --git a/web-framework/nodejs/express/src/code/index.js b/web-framework/nodejs/express/src/code/index.js index 94787a183..3f9971709 100644 --- a/web-framework/nodejs/express/src/code/index.js +++ b/web-framework/nodejs/express/src/code/index.js @@ -15,7 +15,7 @@ app.all("/*", (req, res) => { res.send( JSON.stringify({ msg: "Hello, World! ", - reqeust: { + request: { query: req.query, path: req.originalUrl, data: req.body, diff --git a/web-framework/nodejs/fastify/publish.yaml b/web-framework/nodejs/fastify/publish.yaml index b1da72775..0c191aed2 100755 --- a/web-framework/nodejs/fastify/publish.yaml +++ b/web-framework/nodejs/fastify/publish.yaml @@ -1,7 +1,7 @@ Edition: 3.0.0 Type: Project Name: start-fastify-v3 -Version: 0.0.1 +Version: 0.0.2 Provider: - 阿里云 Description: 本案例是将 Fastify 框架,这一基于 Node.js 平台的极简且灵活的 web 应用开发框架,快速创建并部署到阿里云函数计算 FC 。 diff --git a/web-framework/nodejs/fastify/src/code/index.js b/web-framework/nodejs/fastify/src/code/index.js index 4b0c8c431..10d28f079 100644 --- a/web-framework/nodejs/fastify/src/code/index.js +++ b/web-framework/nodejs/fastify/src/code/index.js @@ -18,7 +18,7 @@ fastify.all("/*", {}, async function (request, reply) { .header("my-custom-header", "hello") .send({ msg: "Hello, World! ", - reqeust: { + request: { query: request.query, path: request.url, data: request.body, diff --git a/web-framework/python/flask/publish.yaml b/web-framework/python/flask/publish.yaml index 6fde7288d..320c9a409 100755 --- a/web-framework/python/flask/publish.yaml +++ b/web-framework/python/flask/publish.yaml @@ -3,7 +3,7 @@ Type: Project Name: start-flask-v3 Provider: - 阿里云 -Version: 0.0.15 +Version: 0.0.16 Description: 本案例将Flask框架,这一非常受欢迎的Python Web框架,快捷创建并部署到阿里云函数计算 FC。 HomePage: https://github.com/devsapp/start-web-framework Organization: 阿里云函数计算(FC) diff --git a/web-framework/python/flask/src/code/index.py b/web-framework/python/flask/src/code/index.py index 9329a3a2e..40cdecfef 100644 --- a/web-framework/python/flask/src/code/index.py +++ b/web-framework/python/flask/src/code/index.py @@ -13,7 +13,7 @@ def hello_world(path): response = jsonify( { "msg": "Hello, World!" + " at " + arrow.now().format("YYYY-MM-DD HH:mm:ss"), - "reqeust": { + "request": { "query": str(request.query_string, "utf-8"), "path": path, "data": str(request.stream.read(), "utf-8"),