Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

264
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda