mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
examples: allow for ./v run examples/xvweb/todo
, without needing to first change the current folder to examples/xvweb/
This commit is contained in:
parent
e1655fff1f
commit
a17b54527a
1 changed files with 2 additions and 0 deletions
|
@ -6,6 +6,7 @@ module main
|
|||
|
||||
import x.vweb
|
||||
import db.sqlite
|
||||
import os
|
||||
import time
|
||||
|
||||
struct Todo {
|
||||
|
@ -125,6 +126,7 @@ pub fn (app &App) delete_todo(mut ctx Context, id int) vweb.Result {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
os.chdir(os.dir(@FILE))!
|
||||
// create a new App instance with a connection to the datbase
|
||||
mut app := &App{
|
||||
db: sqlite.connect('todo.db')!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue