use compile-middleware