mirror of
https://github.com/System-End/ip.git
synced 2026-04-19 19:45:06 +00:00
Add index route
This commit is contained in:
parent
db17234b82
commit
c605b83d77
1 changed files with 2 additions and 0 deletions
2
index.ts
2
index.ts
|
|
@ -1,4 +1,5 @@
|
||||||
import { sql } from "bun";
|
import { sql } from "bun";
|
||||||
|
import index from "./index.html";
|
||||||
|
|
||||||
async function q(ip: string) {
|
async function q(ip: string) {
|
||||||
return await sql`
|
return await sql`
|
||||||
|
|
@ -38,6 +39,7 @@ async function q(ip: string) {
|
||||||
|
|
||||||
Bun.serve({
|
Bun.serve({
|
||||||
routes: {
|
routes: {
|
||||||
|
"/": index,
|
||||||
"/ip": async (req, server) => {
|
"/ip": async (req, server) => {
|
||||||
const start = performance.now()
|
const start = performance.now()
|
||||||
const ip = req.headers.get("x-real-ip")
|
const ip = req.headers.get("x-real-ip")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue