question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can i use your API in front POST?

See original GitHub issue

Hi guys. Thank you very much for good job. It’s very good API. But i’m a noob in FrontEnd and can’t understand how i can use your API. I mean. First question : What different between /public and /private? Second : i have code in my VUE client

import axios from 'axios';
export default {
  data () {
    return {
        form: {
        username: '',
        password: '',
      },
    }
  },
 methods: {
    onSubmit (evt) {
      evt.preventDefault()
      // this.$router.push('/home')
    axios.post(`http://localhost:3003/api/login`, this.form)
    .then(response => {
      // JSON responses are automatically parsed.
      this.form = response.data
      sessionStorage.setItem('token',response.data.token);
      this.$router.push('/home')
    })
    .catch(e => {
      console.log(e)
    })
    }
  }

And i have troubles only with Login. Auth service work good. What i have to do for use your api? Can’t understand. Sry for my noobs qust. And thank you for listening. P.S. and ofc. sry for bad eng, from Russia.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Ihavesoulcommented, Jun 1, 2018

Dude, you helped me very much when I answered the second time) I want to close the question, but did not understand how. Sorry. I did everything, everything works fine, thank you very much)

0reactions
aichbauercommented, May 31, 2018

i do not really understand the question…

but you are using here the username as key for the data you post to the server… you should change username to email, but maybe you have to change something in your app somewhere else too…

 data () {
    return {
        form: {
        username: '',
        password: '',
      },
    }
  },
Read more comments on GitHub >

github_iconTop Results From Across the Web

Making Use of APIs in Your Front End | by Patrick Pierre
So in this post, I am going to help you learn more about APIs and how you can use them through a simple...
Read more >
The Ultimate Guide to Accessing & Using APIs - HubSpot Blog
An API call also comprises everything that happens after the ... to build an app and put it in front of thousands of...
Read more >
How to Do an API Integration: Beginners Guide [w - Snipcart
With each HTTP request created, there is always an 'HTTP Verb' that goes along with it. The most commons are GET , POST...
Read more >
How To Use an API with JavaScript (Beginner's Guide ...
In order to find JAAS API section, enter its name in the search box in the RapidAPI service or go to the “Data”...
Read more >
How to securely call an authenticated API from your front end
Your front end needs to access data from an API which requires an API key. If you put this API key in your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found