V
V
Vladislav2020-10-28 08:36:16
Vue.js
Vladislav, 2020-10-28 08:36:16

How to create your own db.json and get it via API via axios, at the real address, and not localhost?

Admins please do not delete my question, I have a big project and I won’t be able to attach it, it’s easier to show it with a screen, thanks for understanding
Hello everyone, look at the data warehouse I use vuex , and through axios I get goods from the db.json file via api , but I think the browser will not accept localhost when building and uploading to the hosting, how to make your own db.json with the same goods , but so that the address is not localhost, but the real http://db.json is there , let's attach a screen for clarity5f9902c352c4f240458426.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav, 2020-10-28
@SlavaMaxwell

advised so https://my-json-server.typicode.com/ and so

Vue.prototype.$serverHost =
  process.env.NODE_ENV === "production" ? "" : "http://тут свой сайт";
Vue.prototype.$templateUrl =
  process.env.NODE_ENV === "production" ? "" : "тут адресс на cms";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question