add simple middleware support for nico server

Example here:

https://github.com/spmjs/nico-cmd/blob/spm3.x/nico.js#L27