# Cant connect client to backend service through docker-compose \`endpoints\`

**URL:** <https://community.okteto.com/t/cant-connect-client-to-backend-service-through-docker-compose-endpoints/379>\
**Category:** Help\
**Created:** [November 25, 2022, 3:36am UTC](https://community.okteto.com/t/cant-connect-client-to-backend-service-through-docker-compose-endpoints/379 "2022-11-25T03:36:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JHJHJHJH](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/jhjhjhjh/32/231_2.png) [@JHJHJHJH](https://community.okteto.com/u/JHJHJHJH)\
**Post date:** [November 25, 2022, 3:36am UTC](https://community.okteto.com/t/cant-connect-client-to-backend-service-through-docker-compose-endpoints/379/1 "2022-11-25T03:36:55Z")

</div>

Hi there,

I have a `docker-compose.yml` as follows with `frontend` and `backend` services.  
I tried implementing the `endpoints` directive under the [Docker compose docs](https://www.okteto.com/docs/reference/compose/#endpoints-object-optional).

```auto
version: '3.7'

services:
  backend:
    container_name: backend
    ...
    ports:
      - 4000
  postgres:
    image: postgis/postgis:14-3.3
    ...
    ports:
      - 5432:5432
    volumes:
      - pgdata:/var/lib/postgresql/data
  frontend:
    ...
    ports:
      - 3000
volumes:
  pgdata:
endpoints:
  - path: /
    service: frontend
    port: 3000
  - path: /api
    service: backend
    port: 4000

```

When deployed, 2 endpoints showed up ( **which was expected and correct** )

1. frontend - `https://someurl.cloud.okteto.net`
2. backend - `https://someurl.cloud.okteto.net/api`

The issue was that the fetch request from the frontend using `https://someurl.cloud.okteto.net/api` coudn’t find the api endpoint. Resulting in the following error :  
` Failed to load resource: the server responded with a status of 404 (Not Found)`

I suspect this is a k8s networking issue but Im not sure since I have almost zero experience with k8s **(Thats why I love okteto ! ❤)**

Really appreciate any help/ advice on this !

Sincerely  
Han
