Express TS project
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213
  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. });