Express TS project
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

13 řádky
416 B

  1. import express from 'express';
  2. import passport from 'passport';
  3. import { IUser } from '../../models/user';
  4. export const userProfileRoutes = express.Router();
  5. export const jwtAuthentication = passport.authenticate('jwt', { session: false });
  6. userProfileRoutes.get('/profile/', jwtAuthentication, async (request, response) => {
  7. const user: IUser = (request.user as any);
  8. response.json(user);
  9. return;
  10. });