nitter/src/routes/embed.nim

18 lines
421 B
Nim
Raw Normal View History

2019-12-06 14:15:56 +00:00
import asyncdispatch, strutils, sequtils, uri, options
import jester
import router_utils
import ".."/[api, types, agents]
import ../views/[embed]
2020-05-26 12:24:41 +00:00
export getVideo
2019-12-06 14:15:56 +00:00
export embed
proc createEmbedRouter*(cfg: Config) =
router embed:
get "/i/videos/tweet/@id":
2019-12-09 23:39:12 +00:00
let tweet = Tweet(id: @"id".parseBiggestInt, video: some Video())
2019-12-06 14:15:56 +00:00
await getVideo(tweet, getAgent(), "")
resp renderVideoEmbed(cfg, tweet)