resource middleware: don't rely on express path parser
remove erroneous require