Skip to content

Commit 788e072

Browse files
committed
Add tests for NGINX_API_PATHS case
1 parent a803cfa commit 788e072

File tree

15 files changed

+152
-0
lines changed

15 files changed

+152
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NGINX_API_PATHS=api,custom-api
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
http:
3+
api default headers: &api-response
4+
body:
5+
- 'Hey from index.mjs'
6+
headers:
7+
- 'Access-Control-Allow-Origin: *'
8+
- 'Referrer-Policy: no-referrer'
9+
- 'Strict-Transport-Security'
10+
- 'X-Content-Type-Options: nosniff'
11+
- 'X-Robots-Tag: none'
12+
status: 200
13+
url: http://localhost:8080/api/foo
14+
custom api default headers:
15+
<<: *api-response
16+
url: http://localhost:8080/custom-api/foo
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
command:
3+
node monitor:
4+
exec: 's6-svstat -u /run/service/node-memory-monitor'
5+
exit-status: 0
6+
stdout:
7+
- 'true'
8+
port:
9+
tcp:8080:
10+
listening: true
11+
ip:
12+
- 0.0.0.0
13+
process:
14+
nginx:
15+
running: true
16+
node:
17+
running: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NGINX_API_PATHS=api,custom-api
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
http:
3+
api default headers: &api-response
4+
body:
5+
- 'Hey from index.mjs'
6+
headers:
7+
- 'Access-Control-Allow-Origin: *'
8+
- 'Referrer-Policy: no-referrer'
9+
- 'Strict-Transport-Security'
10+
- 'X-Content-Type-Options: nosniff'
11+
- 'X-Robots-Tag: none'
12+
status: 200
13+
url: http://localhost:8080/api/foo
14+
custom api default headers:
15+
<<: *api-response
16+
url: http://localhost:8080/custom-api/foo
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
command:
3+
node monitor:
4+
exec: 's6-svstat -u /run/service/node-memory-monitor'
5+
exit-status: 0
6+
stdout:
7+
- 'true'
8+
port:
9+
tcp:8080:
10+
listening: true
11+
ip:
12+
- 0.0.0.0
13+
process:
14+
nginx:
15+
running: true
16+
node:
17+
running: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NGINX_API_PATHS=api,custom-api
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
http:
3+
api default headers: &api-response
4+
body:
5+
- 'Hey from server.js'
6+
headers:
7+
- 'Access-Control-Allow-Origin: *'
8+
- 'Referrer-Policy: no-referrer'
9+
- 'Strict-Transport-Security'
10+
- 'X-Content-Type-Options: nosniff'
11+
- 'X-Robots-Tag: none'
12+
status: 200
13+
url: http://localhost:8080/api/foo
14+
custom api default headers:
15+
<<: *api-response
16+
url: http://localhost:8080/custom-api/foo
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
port:
3+
tcp:8080:
4+
listening: true
5+
ip:
6+
- 0.0.0.0
7+
process:
8+
nginx:
9+
running: true
10+
node:
11+
running: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NGINX_API_PATHS=api,custom-api

0 commit comments

Comments
 (0)