Skip to content

Commit

Permalink
fix jsmod
Browse files Browse the repository at this point in the history
  • Loading branch information
medvednikov committed Apr 6, 2022
1 parent f49e8d4 commit 1aaeb02
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions main.v
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,12 @@ pub fn (mut app App) mod(name string) vweb.Result {
}

['/jsmod/:name']
pub fn (mut app App) jsmod() {
name := app.req.url.replace('jsmod/', '')[1..]
println('MOD name=$name')
pub fn (mut app App) jsmod(name string) vweb.Result {
// name := app.req.url.replace('jsmod/', '')[1..]
println('jsMOD name=$name')
app.mods_repo.inc_nr_downloads(name)
mod := app.retrieve(name) or {
app.json('404')
return
}
app.json(json.encode(mod))
mod := app.retrieve(name) or { return app.json('404') }
return app.json(json.encode(mod))
}

// "/post/:id/:title"
Expand Down

0 comments on commit 1aaeb02

Please sign in to comment.