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

316
Visualizações
Using a Flask endpoint in Vue component without fetch/axios

It's the weekend and I need to fill in some hours but I'm stuck on all my tasks. I can't figure out how the backend of the application I'm working on interacts with the front end. So far I have an endpoint that I can access that gives me the data:

@app.route('secure/endpointexample', methods=['GET'])
def get_data_from_backend():
   return jsonify(data_from_backend)

And I have a route that renders a template which is created using rollup Vue plugin.

@app.route('secure/renderexampletemplate', methods=['GET'])
def render_example_template():
   return render_template('example.html', data = get_data_from_Backend())

Finally, I'm trying to use the data in my Vue component like so:

<template>
  <div>
    <div v-for="datum in data" :key="datum.id">
      <p> datum.name </p>
    </div>
  </div>
</template>

I'm getting a message in the console to the effect that it's not finding the property (data).

I've tried using axios and javascript's fetch function but one requires installing a dependency and the other just doesn't work. I'm trying to use another application that my team built as an example and I've searched high and low for how they're accessing the api endpoints but nothing has come up.

Is there a way to access endpoints using pure flask or maybe another way that I'm not aware of?

about 4 years ago · Juan Pablo Isaza
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