code: public static final ChannelInitializer<Channel> httpServer(
        final SimpleChannelInboundHandler<HttpRequest> handler) {
      Preconditions.checkArgument(handler.isSharable());
      return new ChannelInitializer<Channel>() {
  
        @Override
        protected void initChannel(Channel channel) throws Exception {
          ChannelPipeline pipeline = channel.pipeline();
          pipeline.addLast("httpCodec", new HttpServerCodec());
          pipeline.addLast("aggregator", new HttpObjectAggregator(10 * 1024 * 1024));
          pipeline.addLast("httpServerHandler", handler);
        }
      };
    }
docs: Returns a new chanel initializer suited to decode and process HTTP
  requests.
  
  @param handler the handler implementing the application logic