Я довольно новичок в Node.js и столкнулся с проблемой, когда я хочу отправить электронное письмо по почте и использовать его на моей стороне сервера.
Кто-нибудь знает, как мне это использовать?
С уважением.
Мой код:
Клиентская сторона
это app.component.html
<a class="nav-link" style="cursor:pointer" *ngIf="_authService.loggedIn()"
(click)="_authService.logoutUser()" >Logout</a>
auth.service.ts
logoutUser()
{
this.userEmail = localStorage.getItem('email')
localStorage.removeItem('token')
localStorage.removeItem('email')
this._router.navigate(['/login'])
this.logUser(this.userEmail).subscribe(
res => this.menu = res,
err => console.log(err)
)
}
logUser(userEmail:any)
{
return this.http.post<any>(this._logOut,userEmail)
}
Сторона сервера:
api.js
router.post('/logout', (req, res) => {
userData = req.body
console.log(userData)
})