Why I cannot access the port of my machine from hasura?

Published

I am trying to create the trigger in Hasura, I’ve created a local API runing o port 5000 that is this

const express = require('express')
const bodyParser = require('body-parser');
const cors = require('cors')
const app = express()
app.use(cors({
    origin: '*'
}));

app.use(bodyParser.urlencoded({
    extended: true
}))


app.post('/notify', function (req, res) {
    console.log(req);
    res.json({
        ok: true,
        token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.UAESEvch27JtozaRKhoLZpqRCx1RyNJdlc0TeEymZtg'
    });
})

app.listen(process.env.PORT || 5000, () => {
    console.log('App is ready running');
})

And I’ve crea a Hasura Container thant uses the port 8084 in my computer, I have configured the trigger to point to my local api using http://host.docker.internal:5000/notify
hasura docker

but container cannot reach my api on my real machine
enter image description here

Source: Docker Questions

Published
Categorised as docker, hasura, hasura-docker, node.js Tagged , , ,

Answers

Leave a Reply

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq