template/api-server: introduce middleware.json

Rework the scaffolded server app to register middleware via
the new `middleware.json` file.

Note: `serve-static` is kept inside `server/server.js` for now,
as there isn't any mechanism for resolving paths in middleware config
specified in `middleware.json`. I will fix this later.

/to @ritch @raymondfeng please review