UNPKG

create-express-with-typescript

Version:

Create Express app is a tamplate which is use to Create a express app templete api

23 lines (17 loc) 460 B
import { NextFunction, Request, Response } from "express"; class Auth { private userid:number | undefined constructor(){ this.userid; } public VerifyUser(req:Request, res:Response,next:NextFunction):any { const userid = req.params; if(userid.id) next(); else{ throw new Error("Invalid User id"); } } } const auth = new Auth(); export default auth;