How to enable api into js-ipfs

Hello guys,

i try to run a ipfs instance into js-ipfs for my need i need to enable api and webui when i run ipfs node here you can find my current code

const IPFS = require('ipfs')
const node = await IPFS.create({config:{Addresses:{API:'/ip4/127.0.0.1/tcp/5002'}}

but we i try to curl my 127.0.0.1:5002 not application seems listen on that.

Any idea ?

I asked the same question on GitHub, you should run the API server with a separate command. See Node created with IPFS.create() doesn't accept HTTP API requests · Issue #3563 · ipfs/js-ipfs · GitHub