mirror of
https://github.com/zedeus/nitter
synced 2026-09-06 07:09:31 +00:00
Routing updates
This commit is contained in:
parent
2950c0de35
commit
4c928fa8b0
10 changed files with 189 additions and 107 deletions
|
|
@ -1,17 +1,14 @@
|
|||
import asyncdispatch, strutils, sequtils, uri, options
|
||||
|
||||
import jester
|
||||
|
||||
import router_utils
|
||||
import ".."/[api, types, agents]
|
||||
import ../views/[embed]
|
||||
export getVideo
|
||||
import ".."/[types, api], ../views/embed
|
||||
|
||||
export embed
|
||||
|
||||
proc createEmbedRouter*(cfg: Config) =
|
||||
router embed:
|
||||
get "/i/videos/tweet/@id":
|
||||
let tweet = Tweet(id: @"id".parseBiggestInt, video: some Video())
|
||||
await getVideo(tweet, getAgent(), "")
|
||||
resp renderVideoEmbed(cfg, tweet)
|
||||
let convo = await getTweet(@"id")
|
||||
if convo == nil or convo.tweet == nil or convo.tweet.video.isNone:
|
||||
resp Http404
|
||||
|
||||
resp renderVideoEmbed(cfg, convo.tweet)
|
||||
|
|
|
|||
Loading…
Reference in a new issue