I want to create a user authentication middleware for an application. I will not use any data from database for this authentication. Suppose,
var user = "me";
function authme(){
//condition}
I will use "authme" in my router as a middleware.
app.post('/api', authme, function(res, req){
})
I want to write authme function in a way so that when user=me, it routes this api. I know this is very basic, but I could not make this happen. Thank you in advance.