You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
500 B

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);
}
}