diff --git a/modules/archive/lib.py b/modules/archive/lib.py index 67ada869..b5bc2cea 100644 --- a/modules/archive/lib.py +++ b/modules/archive/lib.py @@ -8,7 +8,7 @@ import tempfile from dataclasses import dataclass from datetime import datetime from itertools import groupby -from typing import Iterator, Optional +from typing import Iterator, Optional, Tuple, List import requests from bs4 import BeautifulSoup @@ -562,7 +562,7 @@ def get_domains(): return domains -def search(search_str: str, domain: str, limit: int, offset: int): +def search(search_str: str, domain: str, limit: int, offset: int) -> Tuple[List[Archive], int]: with get_db_curs() as curs: columns = 'id, COUNT(*) OVER() AS total' params = dict(offset=offset, limit=limit) diff --git a/nginx.conf b/nginx.conf index c824520a..f7fdcceb 100644 --- a/nginx.conf +++ b/nginx.conf @@ -29,19 +29,24 @@ http { location / { # React APP proxy_pass http://127.0.0.1:5000; - rewrite $1 break; + rewrite $1 break; } location /sockjs-node { proxy_pass http://127.0.0.1:5000; - proxy_http_version 1.1; + proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } location /api { proxy_pass http://127.0.0.1:8081; - rewrite /^api(.*)$ $1 break; + rewrite /^api(.*)$ $1 break; + } + + location /docs { + proxy_pass http://127.0.0.1:8081; + rewrite /^docs(.*)$ $1 break; } location /media { diff --git a/nginx.dev.conf b/nginx.dev.conf index e321ea28..e2a7eaca 100644 --- a/nginx.dev.conf +++ b/nginx.dev.conf @@ -22,19 +22,24 @@ http { location / { # React APP proxy_pass http://app:3000; - rewrite $1 break; + rewrite $1 break; } location /sockjs-node { proxy_pass http://app:3000; - proxy_http_version 1.1; + proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } location /api { proxy_pass http://api:8081; - rewrite /^api(.*)$ $1 break; + rewrite /^api(.*)$ $1 break; + } + + location /docs { + proxy_pass http://api:8081; + rewrite /^docs(.*)$ $1 break; } location /media { diff --git a/wrolpi/root_api.py b/wrolpi/root_api.py index 4fa81931..9905a477 100644 --- a/wrolpi/root_api.py +++ b/wrolpi/root_api.py @@ -80,7 +80,7 @@ index_html = ''' This is a WROLPi API.