新增部分测试

This commit is contained in:
ExplodingDragon
2025-11-15 01:21:16 +08:00
parent 3492dead8d
commit 7bfcb495f4
4 changed files with 12 additions and 5 deletions

View File

@@ -1,5 +1,8 @@
routes:
- path: "api/v1/**"
- path: "api/dev/**"
qjs:
exec: "index.js"
debug: true
debug: true
- path: "api/prod/**"
qjs:
exec: "json.js"

View File

@@ -5,7 +5,7 @@
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<title>Quickjs 概念验证</title>
</head>
<body>

View File

@@ -1,7 +1,7 @@
response.write("hello world")
console.log("hello world")
console.log(req.methaaod)
function aaa(){
function testError(){
throw Error("Method not implemented")
}
aaa()
testError()

4
examples/QuickJS/json.js Normal file
View File

@@ -0,0 +1,4 @@
resp.setHeader("content-type", "application/json");
resp.write(JSON.stringify({
'method': req.method,
}))