Skip to content

Commit 043b00b

Browse files
支持 js websocket
1 parent 268f21c commit 043b00b

File tree

25 files changed

+617
-69
lines changed

25 files changed

+617
-69
lines changed

examples/js/.pages.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/js/json.js

Lines changed: 0 additions & 4 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
routes:
2+
- path: "hello"
3+
js:
4+
exec: "index.js"
5+
debug: true
6+
- path: "json"
7+
js:
8+
exec: "json.js"
9+
debug: true

examples/js/index.html renamed to examples/js_hello_world/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<title>JS 概念验证</title>
99
</head>
1010
<body>
11-
11+
<a href="/hello">Hello World</a>(<a href="/hello?debug=true">Debug</a>) |
12+
<a href="/json">Json</a> (<a href="/json?debug=true">Debug</a>)
1213
</body>
1314
</html>
File renamed without changes.

examples/js_hello_world/json.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
response.setHeader("content-type", "application/json");
2+
response.write(JSON.stringify({
3+
'method': request.method,
4+
}))
File renamed without changes.

0 commit comments

Comments
 (0)