Compare commits
No commits in common. "3ac395e1ab18f240f892bd8ceed4f04e5a433283" and "2b692544167192cd10d4b1198ac7e8a3be6663ae" have entirely different histories.
3ac395e1ab
...
2b69254416
6 changed files with 8 additions and 14 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,6 +1,4 @@
|
||||||
*.db
|
*.db
|
||||||
gw
|
gw
|
||||||
gw.exe
|
gw.exe
|
||||||
gw_linkerArgs.txt
|
gw_linkerArgs.txt
|
||||||
web/node_modules
|
|
||||||
public
|
|
6
package-lock.json
generated
6
package-lock.json
generated
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"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-CnOGj8CL.js"></script>
|
<script type="module" crossorigin src="/public/assets/index-Ccw9dgTj.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,6 +15,8 @@ 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 =
|
||||||
|
@ -44,7 +46,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("referral"))
|
generate_referral(key,referral, ctx.request.hostName, $ctx.request.getHeader("header"))
|
||||||
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("/entry", {
|
let res = await fetch("http://localhost:8080/entry", {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: { referral }
|
headers: { referral }
|
||||||
})
|
})
|
||||||
|
@ -141,4 +141,4 @@ export const Home = () => {
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
};
|
};
|
Loading…
Reference in a new issue