Skip to content

Commit 54f0ee0

Browse files
committed
Fix NGINX
1 parent 4f779da commit 54f0ee0

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/Servers/NginxServer/echo.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,12 @@ function echo(r) {
77
r.return(200, body);
88
}
99

10-
export default { echo };
10+
function handler(r) {
11+
if (r.method === 'POST') {
12+
r.return(200, r.requestText || '');
13+
} else {
14+
r.return(200, 'OK');
15+
}
16+
}
17+
18+
export default { echo, handler };

src/Servers/NginxServer/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ http {
2727
}
2828

2929
location / {
30-
return 200 "OK";
30+
js_content echo.handler;
3131
}
3232
}
3333
}

0 commit comments

Comments
 (0)