I have two services, a client and a server. I am using `Next.js` and `React` on the client and `express` for my server. And I have a docker-compose file. I need to implement some endpoints on the backend and make requests from the client to the backend using `axios`.

During development I am running `docker-compose up`. While working on the app I created an address form in the client and wanted to see the results in the browser. When I try to submit the form and send the request to the server I am getting `404`. This is the code in the client that makes a request to the backend:

```
import axios from 'axios'

const postNewAddress = async (address) => {
  axios.post('/address', address)
    .then(function (response) {
      console.log(response);
    })
    .catch(function (error) {
      console.log(error);
    });
  }

 module.exports = {
   postNewAddress
 }  

```

And this is what I currently have on the backend:

```
const express = require( 'express' );

const app = express();
const port = process.env.PORT || 3001

app.use(express.json())

app.get( '/', ( req, res ) => {
  res.send({ greeting: 'Hello world!' });
});

app.post('/address', ( req, res ) => {
 const address = req.body
 console.log(address)
 res.json(address)
})

app.listen(port, err => {
 if (err) throw err;
 console.log(`Listening on PORT ${port}!`)
})

```

When I change the URL to `http://server:3001/address` in `axios` request, I am getting `net::ERR_NAME_NOT_RESOLVED` error. I did some research and that happens probably because the browser and docker containers are running in different networks. But I couldn't find any solution that would allow me to make requests to container from a browser.

Here is the gist for `docker-compose.yml`

[Docker compose file](https://gist.github.com/sashaProdan/a28becd873ce54272981a4ae32e5ebb5)