Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!