:3
This commit is contained in:
parent
2b69254416
commit
9b2db30a82
6 changed files with 13 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@
|
||||||
gw
|
gw
|
||||||
gw.exe
|
gw.exe
|
||||||
gw_linkerArgs.txt
|
gw_linkerArgs.txt
|
||||||
|
web/node_modules
|
||||||
|
|
6
package-lock.json
generated
Normal file
6
package-lock.json
generated
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"name": "gw",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {}
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
|
@ -6,7 +6,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
<title>Vite + Preact</title>
|
<title>Vite + Preact</title>
|
||||||
<script type="module" crossorigin src="/public/assets/index-Ccw9dgTj.js"></script>
|
<script type="module" crossorigin src="/public/assets/index-CnOGj8CL.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/public/assets/index-CHOkfbIW.css">
|
<link rel="stylesheet" crossorigin href="/public/assets/index-CHOkfbIW.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -15,8 +15,6 @@ sql"""CREATE TABLE IF NOT EXISTS keys(
|
||||||
)""")
|
)""")
|
||||||
|
|
||||||
proc index*(ctx: Context) {.async.} =
|
proc index*(ctx: Context) {.async.} =
|
||||||
for x in db.fastRows(sql"SELECT * FROM keys"):
|
|
||||||
echo x
|
|
||||||
await ctx.staticFileResponse("public/index.html", "")
|
await ctx.staticFileResponse("public/index.html", "")
|
||||||
|
|
||||||
proc ip_exists*(ip: string): bool =
|
proc ip_exists*(ip: string): bool =
|
||||||
|
@ -46,7 +44,7 @@ proc gentry*(ctx: Context) {.async.} =
|
||||||
ip_exists(ctx.request.hostName)) and not table_empty()) and not debug:
|
ip_exists(ctx.request.hostName)) and not table_empty()) and not debug:
|
||||||
err = true
|
err = true
|
||||||
else:
|
else:
|
||||||
generate_referral(key,referral, ctx.request.hostName, $ctx.request.getHeader("header"))
|
generate_referral(key,referral, ctx.request.hostName, $ctx.request.getHeader("referral"))
|
||||||
err = false
|
err = false
|
||||||
|
|
||||||
var info = %*
|
var info = %*
|
||||||
|
|
|
@ -21,7 +21,7 @@ export const Home = () => {
|
||||||
}, [referral]);
|
}, [referral]);
|
||||||
|
|
||||||
const entry = async () => {
|
const entry = async () => {
|
||||||
let res = await fetch("http://localhost:8080/entry", {
|
let res = await fetch("/entry", {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: { referral }
|
headers: { referral }
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue