W
W
Wasya UK2018-07-16 21:10:07
API
Wasya UK, 2018-07-16 21:10:07

How to make a website with api?

I am learning to make a website that works on the basis of api. The server on the node just manages uploading and receiving files, and the server from create-react-app on another port works with the functionality of the first one. There was a question about the authorization of the user ... The question is: "On which server should authorization be present, and am I moving in the right direction?". In this matter, I am a complete 0! I will be glad to all advice)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
spaceatmoon, 2018-07-16
@spaceatmoon

API authorization is easy. You go through authorization as on a regular site by sending a login + password and you get a token. You shove this token into all subsequent requests. No cookies, sessions.

A
Alex, 2018-07-17
@mr_ko

You need to dig towards the JWT for the selected api framework. If this is express, then here is either https://www.npmjs.com/package/express-jwt
And it works according to the principle as
described by spaceatmoon

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question