Ipfs-http-client not able to add file to local node (IPFS-desktop), connection stable

Hello, I have a react-app running, where I try to connect to my local node via ipfs-http-client:

import { create, urlSource } from 'ipfs-http-client'

async function submit(){

      var client = create(new URL(""));


      var file = await client.add("Test");


Connection to local node is working, web-app port also set in config.json:

"API": {
		"HTTPHeaders": {
			"Access-Control-Allow-Origin": [

Restarted daemon and webapp. Also reinstalled IPFS-Desktop. But adding the file is not working, also not fetchable from public gateway after adding. Connection to node is working and HTTP-status 200 is returned and body returns:

1. Hash: "QmQrXZ4iXdEKQMiQT6GRg2Wy3vxb9exR25sYdaqoHwWWuR"
2. Name: "QmQrXZ4iXdEKQMiQT6GRg2Wy3vxb9exR25sYdaqoHwWWuR"
3. Size: "12"

Strangely enough running


works and kills the daemon.
Thanks for your help, maybe someone of you knows why adding is not working :slight_smile:

Not an expert on the whole JavaScript thing, but, consider my API section:

"API": {
	"HTTPHeaders": {
		"Access-Control-Allow-Methods": [
		"Access-Control-Allow-Origin": [

I see two important differences.

First of all, thanks for your answer because this is a good approach.
I changed the HTTPHeader in the config like you said and the post-request still goes through, but it again didnt work though.

Maybe you have some more ideas?

Unfortunately, I have no experience with JavaScript. Maybe someone else can take it from here.