17
This commit is contained in:
parent
8f88d534c6
commit
9e5b22cdf8
1 changed files with 15 additions and 0 deletions
15
src/main.v
15
src/main.v
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue