Skip to content

Commit ae31f52

Browse files
committed
Some cleanup
1 parent e97b5f0 commit ae31f52

File tree

2 files changed

+2
-84
lines changed

2 files changed

+2
-84
lines changed

server/src/index.ts

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -53,39 +53,6 @@ async function initializeSystem(): Promise<{
5353
gptController: new GPTController(GPTModel.GPT4Turbo),
5454
};
5555
}
56-
// initializeSystem().then(({ dbController, gptController }) => {
57-
// app.use("/", exampleRouter);
58-
// //app.use("/getTable", tableRouter)
59-
// app.use("/api/dataRequest", cascadeRouter(dbController));
60-
// //app.use("/api/adminRequest", adminRouter(dbController, gptController));
61-
// //FOR QUICKLY TESTING A PAPER: Uncomment paper to test it. Run "localhost:3000/parse" in a browser to parse the paper and see results in console
62-
// // app.use("/parse", () => {
63-
// // gptController.runGPTAnalysis(["./test/testfiles/SEE_in-flight_data_for_two_static_32KB_memories_on_high_earth_orbit.pdf"]);
64-
// // // gptController.runGPTAnalysis(["./test/testfiles/A_radiation_tolerant_video_camera_for_high_total_dose_environments.pdf"]);
65-
// // // gptController.runGPTAnalysis(["./test/testfiles/Radiation_effects_predicted_observed_and_compared_for_spacecraft_systems.pdf"]);
66-
// // // gptController.runGPTAnalysis(["./test/testfiles/Solar_flare_proton_environment_for_estimating_downtime_of_spacecraft_CCDs.pdf"]);
67-
// // // gptController.runGPTAnalysis(["./test/testfiles/slvk121.pdf"]);
68-
// // });
69-
70-
// (async () => {
71-
// try {
72-
// await initializeDatabase(); // Call it once
73-
// console.log("Database initialized successfully.");
74-
// } catch (error) {
75-
// console.error("Failed to initialize the database:", error);
76-
// }
77-
// })();
78-
79-
// app.listen(PORT, () => {
80-
// console.log(`Server is running on ${PORT}`);
81-
82-
// // Close the database when the app is shutting down
83-
// process.on("exit", () => {
84-
// dbController.closeDB();
85-
// console.log("Database connection closed.");
86-
// });
87-
// });
88-
// });
8956

9057
(async () => {
9158
try {
@@ -102,11 +69,9 @@ async function initializeSystem(): Promise<{
10269

10370
//for testing
10471

72+
/*
10573
app.get("/test2-gpt", async (req, res) => {
10674
try {
107-
//const pdfFile = "./test/Radiation_effects_predicted_observed_and_compared_for_spacecraft_systems.pdf";
108-
//const pdfFile = "./test/SEE_in-flight_data_for_two_static_32KB_memories_on_high_earth_orbit.pdf"; // Replace with actual file path
109-
//const pdfFile = "./test/Single-Event_Effects_Measurements_on_COTS_Electronic_Devices_for_Use_on_NASA_Mars_Missions.pdf";
11075
const pdfFile = ["./test/Review_of_TID_Effects_Reported_in_ProASIC3_and_ProASIC3L_FPGAs_for_3D_PLUS_Camera_Heads.pdf"];
11176
const pdfFiles = [
11277
"./test/Radiation_effects_predicted_observed_and_compared_for_spacecraft_systems.pdf",
@@ -130,18 +95,7 @@ async function initializeSystem(): Promise<{
13095
res.status(500).json({ error: "GPT analysis failed", details: error });
13196
}
13297
});
133-
app.get("/test-gpt", async (req, res) => {
134-
try {
135-
console.log("Initializing GPTController...");
136-
const gptController = new GPTController(GPTModel.GPT4O);
137-
138-
console.log("Running GPT Analysis...");
139-
140-
} catch (error) {
141-
console.error("Error during GPT analysis:", error);
142-
res.status(500).json({ error: "GPT analysis failed", details: error });
143-
}
144-
});
98+
*/
14599

146100
app.listen(PORT, () => {
147101
console.log(`Server is running on ${PORT}`);

server/src/routes/admin-router.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,6 @@ export default function adminRouter(
111111
);
112112
/*
113113
114-
router.post(
115-
"/getFullPapers",
116-
getAuthMiddleware(),
117-
(req: Request, res: Response) => {
118-
try {
119-
// More intricate searches can be employed later similar to the table filter
120-
getFullPaperRows(req.body.search, dbController).then(
121-
(result: TableData[]) => {
122-
res.send(JSON.stringify(result, null, 2));
123-
},
124-
);
125-
} catch (error) {
126-
console.error(`${error}`);
127-
}
128-
},
129-
);
130-
*/
131-
132114
/** Create a new record for any model */
133115
router.post(
134116
"/:model",
@@ -508,16 +490,6 @@ export default function adminRouter(
508490
return router;
509491
}
510492

511-
/*
512-
async function insertRows(
513-
insertData: InsertData[],
514-
dbcontroller: DatabaseController,
515-
): Promise<void> {
516-
for (const paper in insertData) {
517-
await dbcontroller.insertPaper(insertData[paper]);
518-
}
519-
}
520-
*/
521493

522494
async function parsePapers(
523495
files: any,
@@ -531,14 +503,6 @@ async function parsePapers(
531503
return gptResults;
532504
}
533505

534-
/*
535-
async function getFullPaperRows(
536-
search: string,
537-
dbController: DatabaseController,
538-
): Promise<TableData[]> {
539-
return await dbController.getFullData(search);
540-
}
541-
*/
542506

543507
function insertDataRequestFromJSON(body: any): ai_FullDataType[] {
544508
// Ensure body is an array of objects matching the InsertData structure

0 commit comments

Comments
 (0)