File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 22
Original file line number Diff line number Diff line change 44 "description" : " " ,
55 "license" : " MIT" ,
66 "dependencies" : {
7- "serverlesswp" : " ^0.1.2 "
7+ "serverlesswp" : " ^0.2.0 "
88 },
99 "engines" : {
10- "node" : " 18 .x"
10+ "node" : " 22 .x"
1111 }
1212}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ service: serverlesswp-wordpress-starter
22
33provider :
44 name : aws
5- runtime : nodejs18 .x
5+ runtime : nodejs22 .x
66 httpApi :
77 payload : ' 2.0'
88
Original file line number Diff line number Diff line change 1- FROM public.ecr.aws/lambda/nodejs:18
1+ FROM public.ecr.aws/lambda/nodejs:22
22
33COPY package.json ${LAMBDA_TASK_ROOT}/
44RUN npm install --omit=optional --omit=dev
@@ -12,6 +12,4 @@ COPY test/installer.php ${LAMBDA_TASK_ROOT}/wp/
1212
1313RUN sed -i 's#{SQLITE_IMPLEMENTATION_FOLDER_PATH}#/tmp/wp/wp-content/plugins/sqlite-database-integration#' ${LAMBDA_TASK_ROOT}/wp/wp-content/db.php
1414
15- RUN echo "define('FQDBDIR', '/tmp/db' );" >> ${LAMBDA_TASK_ROOT}/wp/wp-config.php
16-
1715CMD [ "api/index.handler" ]
Original file line number Diff line number Diff line change 22
33./build-test.sh
44
5- docker run -p 9000:8080 -d - e FQDBDIR=' /tmp/db' --name serverlesswp-test serverlesswp-test
5+ docker run -e FQDBDIR=/tmp/db -p 9000:8080 -d --name serverlesswp-test serverlesswp-test
66
7- curl -s -o /dev/null -w " %{http_code}" -XPOST " http://localhost:9000/2015-03-31/functions/function/invocations" -d ' {"path":"/installer.php"}'
7+ curl -s -o /dev/null -XPOST " http://localhost:9000/2015-03-31/functions/function/invocations" -d ' {"path":"/installer.php"}'
8+
9+ curl -s -XPOST " http://localhost:9000/2015-03-31/functions/function/invocations" -d ' {"path":"/"}'
810
9- curl -s -o /dev/null -w " %{http_code}" -XPOST " http://localhost:9000/2015-03-31/functions/function/invocations" -d ' {"path":"/"}'
1011
1112docker stop serverlesswp-test
1213docker rm serverlesswp-test
Original file line number Diff line number Diff line change 44 ],
55 "functions" : {
66 "api/index.js" : {
7- "memory " : 1024 ,
8- "includeFiles " : " wp/** "
7+ "includeFiles " : " wp/** " ,
8+ "maxDuration " : 60
99 }
1010 },
1111 "build" : {
Original file line number Diff line number Diff line change 9191
9292/* Add any custom values between this line and the "stop editing" line. */
9393
94- define ('MYSQL_CLIENT_FLAGS ' , MYSQLI_CLIENT_SSL );
94+ if (!isset ($ _ENV ['SKIP_MYSQL_SSL ' ])) {
95+ define ('MYSQL_CLIENT_FLAGS ' , MYSQLI_CLIENT_SSL );
96+ }
97+
9598$ _SERVER ['HTTPS ' ] = 'on ' ;
9699
100+ // Inject the true host.
101+ $ headers = getallheaders ();
102+ if (isset ($ headers ['injectHost ' ])) {
103+ $ _SERVER ['HTTP_HOST ' ] = $ headers ['injectHost ' ];
104+ }
105+
97106// Optional S3 credentials for file storage.
98107if (isset ($ _ENV ['S3_KEY_ID ' ]) && isset ($ _ENV ['S3_ACCESS_KEY ' ])) {
99108 define ( 'AS3CF_SETTINGS ' , serialize ( array (
You can’t perform that action at this time.
0 commit comments