P
P
panikev2021-06-18 06:36:02
Express.js
panikev, 2021-06-18 06:36:02

Why is axios + express running for a long time?

Hello! There is a mobile application that directly accesses the 1c http service within the local network. I wanted to implement the ability to access data via the Internet, but in order to protect 1C, I decided to create an intermediate backend on nodejs, with an API key and authorization. But how now to implement a data request from Node to 1C?
wrote this method:

app.get('/getProducts/:group', async function(req, res) {
   await  axios.get(`http://192.168.1.100/App/hs/market/${req.params.version}`,{
        auth: {
          username: "",
          password: "",
        },
      })
      .then((data) => {
        res.send(data.data)   
      })
  });

but it works very slowly.
Tell me, please. how right?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question