Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1732)

Unified Diff: third_party/pkg/angular/playback_middleware/lib/middleware.js

Issue 1058283006: Update pubspecs and dependencies to get pkgbuild tests working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/pkg/angular/playback_middleware/lib/middleware.js
diff --git a/third_party/pkg/angular/playback_middleware/lib/middleware.js b/third_party/pkg/angular/playback_middleware/lib/middleware.js
deleted file mode 100644
index 09382e1f35b9e3fc3760a753e8edb3bb1a791d4f..0000000000000000000000000000000000000000
--- a/third_party/pkg/angular/playback_middleware/lib/middleware.js
+++ /dev/null
@@ -1,50 +0,0 @@
-
-var url = require('url');
-var playback = require('./playback.js');
-
-/**
- * Returns connect middleware that will record and playback for Angular.dart's
- * HTTP playback service.
- * @param opts
- * path is the path where the record / playback endpoint is served
- * playbackImpl is the playback module, used for mocking
- * @returns {Function}
- */
-function endpoint(opts) {
- opts = opts || {};
- opts.path = opts.path || '/record';
- opts.playbackImpl = opts.playbackImpl || playback.playback();
-
-
- return function playbackEndpoint(req, res, next) {
- if (url.parse(req.url).path != opts.path) {
- next();
- return;
- }
-
- if (req.method == 'POST') {
- var body = '';
- req.on('data', function(data) {
- body += data;
- });
- req.on('end', function() {
- var parsedBody = JSON.parse(body);
-
- opts.playbackImpl.record(parsedBody.key, parsedBody.data);
- res.writeHead(200);
- res.end();
- });
- } else if (req.method == 'GET') {
- var data = opts.playbackImpl.playback();
- res.writeHead(200, {
- 'Content-Type': 'application/dart',
- 'Content-Length': Buffer.byteLength(data)
- });
- res.end(data);
- }
- }
-}
-
-module.exports = {
- endpoint: endpoint
-};
« no previous file with comments | « third_party/pkg/angular/playback_middleware/README.md ('k') | third_party/pkg/angular/playback_middleware/lib/playback.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698