Skip to content

Commit

Permalink
added basic api /videos function #31
Browse files Browse the repository at this point in the history
  • Loading branch information
mrharpo committed Mar 14, 2020
1 parent fe1856a commit 55e7274
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from partial import PartialFileResponse
from uvicorn import run
from os.path import join
from os import listdir
from urllib.request import urlopen
from subprocess import run as bash
from db import db
Expand Down Expand Up @@ -109,6 +110,10 @@ def cancelRender():
def getProjects(user: User = Depends(get_current_active_user)):
return ['demo.csv', 'external.csv', 'moon.csv', 'train.csv', 'xmas.csv']

@app.get('/videos')
async def getVideos():
return listdir('videos')

@app.get('/videos/{video}', responses={
206: {'content': {'video/mp4': {}},
'description': 'partial video response'}
Expand Down

0 comments on commit 55e7274

Please sign in to comment.