Home > front end >  Why I cannot access the port of my machine from hasura?
Why I cannot access the port of my machine from hasura?

Time:10-24

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 hasura docker

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

CodePudding user response:

From the pictures I can see that you are not using windows so host.docker.internal won't work for you see What is linux equivalent of "host.docker.internal"

  • Related