Skip to content

Commit

Permalink
examples: allow for ./v run examples/xvweb/todo, without needing to…
Browse files Browse the repository at this point in the history
… first change the current folder to examples/xvweb/
  • Loading branch information
spytheman committed Jan 25, 2024
1 parent e1655ff commit a17b545
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/xvweb/todo/main.v
Expand Up @@ -6,6 +6,7 @@ module main

import x.vweb
import db.sqlite
import os
import time

struct Todo {
Expand Down Expand Up @@ -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')!
Expand Down

0 comments on commit a17b545

Please sign in to comment.