-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathServer.hx
More file actions
38 lines (31 loc) · 917 Bytes
/
Server.hx
File metadata and controls
38 lines (31 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import ufront.app.UfrontApplication;
import ufront.view.TemplatingEngines;
import app.controller.*;
import ufront.mailer.*;
import sys.db.*;
class Server {
static var ufApp:UfrontApplication;
static function main() {
ufApp = new UfrontApplication({
indexController: HomeController,
templatingEngines: [TemplatingEngines.erazor],
defaultLayout: "layout.html",
logFile: "logs/helloworld.log"
});
var smtpMailer = null; // new SMTPMailer(Config.server.smtp);
var dbMailer = new DBMailer( smtpMailer );
ufApp.inject( UFMailer, dbMailer );
// Execute the main request.
run();
// If we're on neko, and using the module cache, next time jump straight to the main request.
#if (neko && !debug)
neko.Web.cacheModule(run);
#end
}
static function run() {
var cnx = Mysql.connect( Config.mysql );
Transaction.main( cnx, function () {
ufApp.executeRequest();
});
}
}