diff --git a/config/config.yaml b/config/config.yaml index 93bfec7..09fa0e5 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -6,6 +6,7 @@ Server: Web: host: 127.0.0.1 port: 8000 + static_folder: frontend/build Database: username: foo diff --git a/docs/conf.py b/docs/conf.py index 0a415e5..aa77d65 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,29 +6,28 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = 'shortenit' -copyright = '2024, Elia el Lazkani' -author = 'Elia el Lazkani' -release = '0.0.0' +project = "shortenit" +copyright = "2024, Elia el Lazkani" +author = "Elia el Lazkani" +release = "0.0.0" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.todo', - 'sphinx.ext.coverage', - 'sphinx.ext.viewcode', - 'sphinx_autodoc_typehints', + "sphinx.ext.autodoc", + "sphinx.ext.todo", + "sphinx.ext.coverage", + "sphinx.ext.viewcode", + "sphinx_autodoc_typehints", ] -templates_path = ['_templates'] +templates_path = ["_templates"] exclude_patterns = [] - # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = 'alabaster' -html_static_path = ['_static'] +html_theme = "alabaster" +html_static_path = ["_static"] diff --git a/frontend/src/components/URLShortener/URLShortener.tsx b/frontend/src/components/URLShortener/URLShortener.tsx index a56dae2..492a964 100644 --- a/frontend/src/components/URLShortener/URLShortener.tsx +++ b/frontend/src/components/URLShortener/URLShortener.tsx @@ -32,14 +32,14 @@ export default function () { // Send the POST request to the backend await axios - .post("http://127.0.0.1:8000/shortenit", { + .post("http://127.0.0.1:8000/api/v1/shorten", { url: url, timestamp: timestamp, }) .then((response) => { if (response) { const code: string = response.data.url; - const fullShortenedUrl: string = `http://127.0.0.1:8000/${code}`; + const fullShortenedUrl: string = `http://127.0.0.1:8000/r/${code}`; setShortenedUrl(fullShortenedUrl); setShowInput(true); } diff --git a/shortenit/templates/index.html b/shortenit/templates/index.html deleted file mode 100644 index 0ba5307..0000000 --- a/shortenit/templates/index.html +++ /dev/null @@ -1,121 +0,0 @@ - - - -
- - - - - - -