Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

261
Visualizações
How can I split my Vue js project into development and test?

I want to divide my vuejs frontend project into two parts as development and test. In the development part, I want to work in my local and request the example:8010 urline, and in the test part, I want to send a request to the example:80 address. How can I do this, I did a source search but couldn't find anything.

Example of a request I wrote:

      var formData = new FormData();
  formData.append('file', this.image[0]);
  await axios
    .post('example', formData, {
      headers: {
        Authorization: `Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6fdsaeqImNoZ3VuYXkzQGdtYWlsLmNvbqSIsImlkIjoxLCJ0eXBlIjoxLCJpYXQiOjE2NDU0NDUxMjR9.Kg8NcFiAKtBHxkQsRwl2pO6svp7SDQSQw13SJ4xe1vc`,
      },
    })

    .then((response) => {
      console.log(response.data.id);

    
    })
    .catch((error) => {
      console.log(error);
    });
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Serkan

You can use .env files for your environments. You can add dotenv package your project, or you can give parameters inside of your scripts part of you package.json

here you can follow this page to use your env variables inside vue app. Keep in mind you must start VUE_APP for your variables:

VUE_APP_BASE_API = 'yourapplink/api'

You should create 2 .env files 1 for your local development other for your production and you can add as much as you like.

You can create .env.development and put your variables in it then start your vue app with:

vue-cli-service build --mode development

And you should see app using your .env.development file.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda