import express from 'express' ; const app = express ( ) ; import path from 'path' ; var http = require ( 'http' ) . createServer ( app ) ; var io = require ( "socket.io" ) ( http ) ; http . listen ( 30009 ) ; var prostgles = require ( "../../dist/index" ) ; import { DBObj } from "./DBoGenerated" ; prostgles ( { dbConnection : { host : "localhost" , port : 5432 , database : "example" , user : process . env . PRGL_USER , password : process . env . PRGL_PWD } , sqlFilePath : path . join ( __dirname + '/init.sql' ) , io , tsGeneratedTypesDir : path . join ( __dirname + '/' ) , publish : ( socket , dbo ) => { return { planes : "*" } ; } , onReady : async ( dbo ) => { let plane = await dbo . planes . findOne ( ) ; app . get ( '/' , ( req , res ) => { res . sendFile ( path . join ( __dirname + '/home.html' ) ) ; } ) ; app . get ( '*' , function ( req , res ) { res . status ( 404 ) . send ( 'Page not found' ) ; } ) ; } , } ) ;