add connect directory middleware support

I want use the connect directory middleware, because everytime type the filename looks like stupid!