Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

137
Vistas
How do I get my client talking to my server API on goorm?

I'm using this tutorial: https://blog.logrocket.com/mern-stack-tutorial/ , but building a bug tracker instead of a book repository.

When I load the root path in the client, I load a ReactJS component ('ShowBugList.js'). That file makes a request to the server (in the same goorm container).

In ShowBugList.js

componentDidMount() {
        axios
            .get('http://localhost:8082/api/bugs/')
            .then((res) => {
                this.setState({
                    bugs: res.data,
                });
            })
            .catch((err) => {
                console.log('Error from ShowBugList');
                console.log(err);
            });
    }

And I'm getting an error there.

api error

I'm also unable to reach that API with postman(of course replacing 'localhost' with the goorm container address).

I checked my web server port and it is 8082.

const port = process.env.PORT || 8082;

app.listen(port, () => console.log(`Server running on port ${port}`));

I'm also, using that route

const bugs = require('./routes/api/bugs');

app.use('/api/bugs/', bugs);

What am I overlooking here?

EDIT 1: I should add that I've looked into any CORS issues and I think I have the correct settings for it in my server-side app.js:

// cors
app.use(cors({ origin: true, credentials: true }));

EDIT 2: Set up a local version on my computer of this and reproduced the issue. So it's not a GoormIDE specific issue but something within the code itself. The search continues.

EDIT 3: I had input https as per the suggestion below and it was causing my error when I moved to a local installation. Going back to http on my local installation got that working. But I'll leave this question open if any one has ideas how to get it working on goorm.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda