Middleware to add the "/" if needed

Just reversed it here but I haven't tested it

basically the position of the / is swapped.