middleware examples