+7
-8
src/main.v
+7
-8
src/main.v
···
70
70
name: 'connect to db'
71
71
log: true
72
72
)
73
-
74
73
defer { app.db.close() or { panic(err) } }
75
74
76
-
// add authenticator
77
-
app.auth = auth.new(app.db)
75
+
// initialize database
76
+
util.time_it(it: fn [mut app] () {
77
+
init_db(mut app)
78
+
}, name: 'init db', log: true)
78
79
79
80
// load sql files kept in beep_sql/
80
81
util.time_it(
···
85
86
log: true
86
87
)
87
88
89
+
// add authenticator
90
+
app.auth = auth.new(app.db)
91
+
88
92
// load validators
89
93
load_validators(mut app)
90
94
91
95
// mount static things
92
96
app.mount_static_folder_at(app.config.static_path, '/static')!
93
-
94
-
// initialize database
95
-
util.time_it(it: fn [mut app] () {
96
-
init_db(mut app)
97
-
}, name: 'init db', log: true)
98
97
99
98
// make the website config, if it does not exist
100
99
app.get_or_create_site_config()