DEV Community

Discussion on: Authentication in NodeJS With Express and Mongo - CodeLab #1

dipakkr profile image
Deepak Kumar Author

Hi Eugene,

You can simply call the API using axios or fetch to get data.

Here is a sample code snippet on how you can do it.

const config = {
            headers: {
                'Content-Type': "application/json"

const formData = {

const response = await'/user/login', formData, config);
Enter fullscreen mode Exit fullscreen mode

I hope this answers your question.

Thread Thread
yugyndprodigy10 profile image
Eugene Taabazuing

It does, thanks!

Thread Thread
grsarvesh profile image

Eugene, could you paste the full code oh how to link front end and back end and specify where it should be added