Add connect middleware for snapshotting and dart2js