Skip to content

Commit

Permalink
Update path api
Browse files Browse the repository at this point in the history
  • Loading branch information
vectornguyen76 committed Nov 24, 2023
1 parent 18b10a1 commit bbf47c5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ async def healthcheck() -> bool:


app.include_router(auth_router, prefix="/auth", tags=["Auth"])
app.include_router(text_search_router, prefix="/text_search", tags=["Text Search"])
app.include_router(image_search_router, prefix="/image_search", tags=["Image Search"])
app.include_router(text_search_router, prefix="/text-search", tags=["Text Search"])
app.include_router(image_search_router, prefix="/image-search", tags=["Image Search"])
2 changes: 1 addition & 1 deletion frontend/.env.production
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NEXT_PUBLIC_API_URL=http://184.73.6.8/backend
NEXT_PUBLIC_API_URL=http://184.73.6.8/api
8 changes: 4 additions & 4 deletions frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function Home() {
const fetchData = async () => {
try {
const { data } = await useAxios.get(
"/text_search/search?query=Áo&size=20"
"/text-search/search?query=Áo&size=20"
);
// Handle the response data here
console.log(data); // Log the data for debugging
Expand All @@ -54,7 +54,7 @@ export default function Home() {

const handleClickSearch = async () => {
setLoading(true);
const apiUrl = `${NEXT_PUBLIC_API_URL}/text_search/search?query=${searchValue}&size=20`;
const apiUrl = `${NEXT_PUBLIC_API_URL}/text-search/search?query=${searchValue}&size=20`;

try {
const response = await useAxios.get(apiUrl);
Expand Down Expand Up @@ -102,7 +102,7 @@ export default function Home() {
return;
}

const apiUrl = `${NEXT_PUBLIC_API_URL}/text_search/auto-complete?query=${value}&size=5`;
const apiUrl = `${NEXT_PUBLIC_API_URL}/text-search/auto-complete?query=${value}&size=5`;
try {
const response = await useAxios.get(apiUrl);
if (response.status === 200) {
Expand Down Expand Up @@ -130,7 +130,7 @@ export default function Home() {

try {
const response = await useAxios.post(
`${NEXT_PUBLIC_API_URL}/image_search/search`,
`${NEXT_PUBLIC_API_URL}/image-search/search`,
formData
);

Expand Down
2 changes: 1 addition & 1 deletion nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ server {
proxy_cache_bypass $http_upgrade;
}

location /backend/ {
location /api/ {
proxy_pass http://backend/;

proxy_set_header Host $host;
Expand Down

0 comments on commit bbf47c5

Please sign in to comment.