diff --git a/validator/build.py b/validator/build.py index 06584ad64d85..a7ffce93f14f 100755 --- a/validator/build.py +++ b/validator/build.py @@ -417,10 +417,8 @@ def CreateWebuiAppengineDist(out_dir): f for f in files if not os.path.isdir(os.path.join(d, f)) and os.path.splitext(f)[1] != '.html']) - webcomponents_out = os.path.join(out_dir, 'webcomponents-lite') - os.mkdir(webcomponents_out) shutil.copyfile('node_modules/webcomponents-lite/webcomponents-lite.js', - os.path.join(webcomponents_out, 'webcomponents-lite.js')) + os.path.join(webui_out, 'webcomponents-lite.js')) logging.info('... success') diff --git a/validator/index.js b/validator/index.js index 5b1266b67e0a..2166045277a0 100755 --- a/validator/index.js +++ b/validator/index.js @@ -410,6 +410,16 @@ function serve(port, validatorScript) { return; } // + // Handle '/amp_favicon.png' + // + if (request.url == '/amp_favicon.png') { + const contents = fs.readFileSync( + path.join(__dirname, 'webui/amp_favicon.png'), 'binary'); + response.writeHead(200, {'Content-Type': 'image/png'}); + response.end(contents, 'binary'); + return; + } + // // Handle fetch?, a request to fetch an arbitrary doc from the // internet. It presents the results as JSON. // diff --git a/validator/webui/amp_favicon.png b/validator/webui/amp_favicon.png new file mode 100644 index 000000000000..a43306c3a6cf Binary files /dev/null and b/validator/webui/amp_favicon.png differ diff --git a/validator/webui/app.yaml b/validator/webui/app.yaml index e77197f35aa4..344120dafca5 100644 --- a/validator/webui/app.yaml +++ b/validator/webui/app.yaml @@ -19,5 +19,9 @@ handlers: upload: polymer/.*\.html$ - url: /webcomponents-lite.js$ - static_files: webcomponents-lite/webcomponents-lite.js - upload: webcomponents-lite/webcomponents-lite\.js$ + static_files: webcomponents-lite.js + upload: webcomponents-lite\.js$ + +- url: /amp_favicon.png$ + static_files: amp_favicon.png + upload: amp_favicon\.png$ diff --git a/validator/webui/index.html b/validator/webui/index.html index 63f5ce7607fd..e007c62c6975 100644 --- a/validator/webui/index.html +++ b/validator/webui/index.html @@ -18,6 +18,7 @@ The AMP Validator +