简体   繁体   中英

How to fix token generate in REST API call?

I'm using angular 7 with loopback for API. But I'm testing one sample code there is have token and token/generate-token i don't know how to generate or how to access except this token. Please help me guys.

API function

  login(loginPayload) : Observable<ApiResponse> {
     return this.http.post<ApiResponse>('http://localhost:3000/' +'token/generate-token', loginPayload);
  }

when I tried this there is an error which shows 404 .

message: "Http failure response for http://localhost:3000/token/generate-token: 404 Not Found"

​ name: "HttpErrorResponse" ​ ok: false ​ status: 404 ​ statusText: "Not Found" ​ url: " http://localhost:3000/token/generate-token "

我被错误地称为API,这就是为什么我无法生成令牌的原因

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM