#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#End Region
'change based on the jdbc jar file
#AdditionalJar: mysql-connector-java-8.0.18
'#AdditionalJar: postgresql-9.4.1207
Sub Process_Globals
Private srvr As Server
Public Mysql As SQL
End Sub
Sub AppStart (Args() As String)
DateTime.DateFormat="yyyy/MM/dd HH.mm.ss"
srvr.Initialize("srvr")
srvr.Port = 51042
srvr.StaticFilesFolder = File.Combine(File.DirApp, "www")
srvr.AddHandler("/guessmynumber/guess", "GuessMyNumber", False)
srvr.AddHandler("/guessmynumber/reset", "ResetMyNumber", False)
srvr.AddWebSocket("/guessmynumber_ws/ws", "WSGuessMyNumber")
srvr.AddHandler("", "index", False)
srvr.AddHandler("/bienvenu", "bienvenu", False)
srvr.AddHandler("/admin", "Admin", False)
srvr.AddHandler("/rh", "rh", False)
srvr.AddHandler("/paie", "paie", False)
srvr.AddHandler("/rappel", "rappel", False)
srvr.AddHandler("/fin", "fin", False)
srvr.AddHandler("/loggeur", "loggeur", False)
Mysql.Initialize2("com.mysql.jdbc.Driver","jdbc:mysql://localhost:3308/rappeltravail?characterEncoding=utf8&useTimezone=true&serverTimezone=America/New_York","user","password")
srvr.Start
StartMessageLoop
'open browser and navigate to: http://127.0.0.1:51042/
End Sub
Sub Handle(req As ServletRequest, resp As ServletResponse)
Dim html, header, footer As Object
html= File.ReadString(File.DirApp, "www/index.php")
header= File.ReadString(File.DirApp, "www/header.php")
footer= File.ReadString(File.DirApp, "www/footer.php")
' Log (html)
Dim sss As StringBuilder
sss.Initialize
sss.Append(header).Append(html).Append(footer).Append("<br>")
resp.ContentType="text/html"
resp.Write(sss)
End Sub