mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-06 02:36:38 +00:00
Add scripts and fix routes
This commit is contained in:
@@ -2,15 +2,11 @@ import { Request, Response, NextFunction } from 'express';
|
||||
import { DrizzleError } from 'drizzle-orm';
|
||||
import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
|
||||
import { sites, Site } from '../../db/schema';
|
||||
|
||||
interface CustomRequest extends Request {
|
||||
db?: BetterSQLite3Database;
|
||||
}
|
||||
import db from '../../db';
|
||||
|
||||
export const getConfig = async (req: Request, res: Response, next: NextFunction): Promise<void> => {
|
||||
try {
|
||||
const customReq = req as CustomRequest;
|
||||
const db = customReq.db;
|
||||
const exitNodeId = req.query.exitNodeId as string;
|
||||
|
||||
if (!db) {
|
||||
throw new Error('Database is not attached to the request');
|
||||
|
||||
Reference in New Issue
Block a user