diff --git a/api/main.py b/api/main.py index 63bb17b..e479765 100644 --- a/api/main.py +++ b/api/main.py @@ -43,8 +43,7 @@ def create_paste(paste: schemas.Paste, db: Session = Depends(get_db)): logger.exception(error) raise HTTPException(status_code=500, detail=str(error)) - url = get_settings().base_url + f"/{db_paste.key}" - return url + return db_paste.key @app.get("/{key}", response_model=schemas.PasteInfo) diff --git a/tests/test_api.py b/tests/test_api.py index 072486a..05d6f43 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -35,8 +35,7 @@ def test_create_and_get_paste(self): expire_date = datetime.datetime.now() + datetime.timedelta(seconds=expire_after) response = self.client.post("/", json=json_request) - url = response.json() - _, key = url.split("/") + key = response.json() self.assertEqual(response.status_code, 200) self.assertEqual(len(key), 4)