import Surreal from "@surrealdb/mod.ts"; import config from "./config.ts"; import { Location } from "./utils.ts"; export interface IP { location: Location; history: { timestamp: Date; path: string; }[]; } export const db = new Surreal(`${config.db.url}/rpc`); export default async function init() { try { await db.signin({ user: config.db.user, pass: config.db.pass, }); } catch (e) { throw new Error(e); } }