This commit is contained in:
myairpods6 2024-06-26 23:34:46 +05:30
parent 8f88d534c6
commit 9e5b22cdf8

View file

@ -2,6 +2,7 @@ module main
import vweb
import os
import databases
const (
port = 8082
@ -16,6 +17,20 @@ pub fn (app App) before_request() {
}
fn main() {
mut db := databases.create_db_connection() or { panic(err) }
sql db {
// create table Faculty (
// id serial primary key,
// name text not null,
// email text not null unique,
// password text not null
// )
create table Auth
} or { panic('error on create table: ${err}') }
db.close() or { panic(err) }
mut app := &App{}
app.serve_static('/favicon.ico', 'src/assets/favicon.ico')
// makes all static files available.