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`.