Add lib/server.js and middleware.