1- import express from "express" ;
1+ import express , { Request , Response , NextFunction } from "express" ;
22import bodyParser from "body-parser" ;
33import path from "path" ;
44import databaseFunctions from "./Utils/databaseFunctions" ;
@@ -52,7 +52,7 @@ async function SqliteGuiNode(db: sqlite3.Database, port = 8080) {
5252
5353// SqliteGuiNode as middleware
5454function SqliteGuiNodeMiddleware ( app : any , db : sqlite3 . Database ) {
55- return async function ( req : any , res : any , next : any ) {
55+ return async function ( req : Request , res : Response , next : NextFunction ) {
5656 try {
5757 await databaseFunctions . InitializeDB ( db ) ;
5858 app . set ( "view engine" , "ejs" ) ;
@@ -63,30 +63,30 @@ function SqliteGuiNodeMiddleware(app: any, db: sqlite3.Database) {
6363 app . use ( bodyParser . json ( ) ) ;
6464
6565 // Routes
66- app . get ( "/query" , ( req : any , res : any ) => {
66+ app . get ( "/query" , ( req : Request , res : Response ) => {
6767 res . render ( "query" , { title : "Query Page" } ) ;
6868 } ) ;
6969
70- app . get ( "/" , ( req : any , res : any ) => {
70+ app . get ( "/" , ( req : Request , res : Response ) => {
7171 res . render ( "index" , { title : "Home Page" } ) ;
7272 } ) ;
7373
74- app . get ( "/createtable" , ( req : any , res : any ) => {
74+ app . get ( "/createtable" , ( req : Request , res : Response ) => {
7575 res . render ( "createTable" , { title : "Create Table Page" } ) ;
7676 } ) ;
7777
78- app . get ( "/insert/:table" , ( req : any , res : any ) => {
78+ app . get ( "/insert/:table" , ( req : Request , res : Response ) => {
7979 const tableName = req . params . table ;
8080 res . render ( "insert" , { tableName } ) ;
8181 } ) ;
8282
83- app . get ( "/edit/:table/:label/:id" , ( req : any , res : any ) => {
83+ app . get ( "/edit/:table/:label/:id" , ( req : Request , res : Response ) => {
8484 const tableName = req . params . table ;
8585 const id = req . params . id ;
8686 res . render ( "edit" , { tableName, id } ) ;
8787 } ) ;
8888 app . use ( "/api/tables" , tableRoutes ( db ) ) ; // Add table routes
89- app . get ( "/home" , ( req : any , res : any ) => {
89+ app . get ( "/home" , ( req : Request , res : Response ) => {
9090 res . render ( "index" , { title : "Home Page" } ) ;
9191 } ) ;
9292
0 commit comments