E
E
efrolova19982018-07-18 12:15:18
Node.js
efrolova1998, 2018-07-18 12:15:18

How to connect server to nuxt?

I make a post request:

<script>
import axios from 'axios'
    methods: {
      news() {
        axios.post("http://x.xx.x.xx./api/news",{
 
  }).then((res) => {
            console.log(res);
            return {res}
          })
      }
    },
</script>

but i need that the request was without http://x.xx.x.xx./. it should be so /api/news.
how to set up the config to implement this?

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