While running an express server, what is the proper way to redirect incoming requests?
I have two routes: POST and UPDATE. The POST route is used to create new item to database and UPDATE increases votes in the item.
I would like to use middleware(?) to redirect my requests based on db content:
if element with req.param does exist => redirect to UPDATE to handle upvotes
else create new element => redirect to POST to handle creation