Private IPFS api exposed outside

Hi Everyone, Can some one help please.
i have developed the private network of 3 nodes. all of them are connected and works fine. I am able to add file through command line and able to fetch it over browser.

But i am finding difficult which i API should i expose outside so that requested would be sent by other application line server.
http://“IP”:port/ipfs/add in attachment there would be file attached. but not able to send the request. The error i get is "Method POST not allowed: read only access"

What should be that API. i can test it through swagger or postman.

Can someone please take a look. i stuck at this point. everything works fine from command line and view api works well over browser. Having issue to add, might be i am passing wrong parameters.

You can make the http gateway writable using the directions in this post:

1 Like

Thank you very much @leerspace for your help. I have changed the writable flag to true but now i dont get hash in response. request doesnt gives me an any error but no hash in response. Below is my api call for adding file. is it correct?
http://“IP address:port”/ipfs/add

attaching a file in body.

That’s not the correct endpoint for the API. It should be to http://<ip address>:<port>/api/v0/add

There’s an example here for how to call the add API in the documentation here:

1 Like

Thank you so much @leerspace for your your help. Everything is working fine now. after changing URL and making gateway.writable = true. Cheers!!!

1 Like