Setting up a static HTML that connects to ipfs and resolves hash

Everything I want to do is take a ipfs hash and output the corresponding element.
I forked
however when trying to use the API nothing works (replace code with script and it says undefined ??)
could you please provide a single working (static) example ?
It would be great to get started with ipfs


maybe that can help you :

The problem isn´t hosting the site on ipfs, I´m not able to connect to IPFS using Javascript (on a static website)

test that in your website :

Was able to run that, however when trying to get or put a object from/ to ipfs it failed.
Would be awesome if you could share any demo that executes the ipfs get file command successfully.

I would like to execute that successfully:

node.files.add(new node.types.Buffer('Hello world!'), (err, filesAdded) => { if (err) { return console.error('Error - ipfs files add', err, res) }
  filesAdded.forEach((file) => console.log('successfully stored', file.hash))

+'QmQzCQn4puG4qu8PVysxZmscmQ5vT1ZXpqo7f58Uh9QfyY', function (err, data) { if (err) { return console.error('Error - ipfs files cat', err, res) }

try that :, function (err, file) {
if (err) {
throw err


do you have proxy ?

const node = new Ipfs({ repo: 'ipfs-' + Math.random() })

node.once('ready', () => {
  console.log('Online status: ', node.isOnline() ? 'online' : 'offline')

})'QmQzCQn4puG4qu8PVysxZmscmQ5vT1ZXpqo7f58Uh9QfyY', function (err, file) {
if (err) {
throw err


“Uncaught TypeError: Cannot read property ‘get’ of undefined”

I don´t have a proxy

beware you need include node.files on node.ready event : you need IPFS node is ready to request on it

Thank you so much <3