diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..17e4709 Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/favicon-192.png b/public/favicon-192.png new file mode 100644 index 0000000..f8556ef Binary files /dev/null and b/public/favicon-192.png differ diff --git a/public/favicon-32.png b/public/favicon-32.png new file mode 100644 index 0000000..c26a897 Binary files /dev/null and b/public/favicon-32.png differ diff --git a/public/index.html b/public/index.html index c58ec3f..a74e8de 100644 --- a/public/index.html +++ b/public/index.html @@ -11,6 +11,9 @@ + + + diff --git a/server.js b/server.js index 2cf5555..f5f53ed 100644 --- a/server.js +++ b/server.js @@ -12,7 +12,15 @@ const SERVICES = ['WiFi Managed Services', 'Cloud IP PABX', 'GRE IPTV', 'Digital // matches the domain's first label, so yahoo.com.my, hotmail.co.uk etc. are covered. // ponytail: fixed list of the common providers; extend if sales sees others slip through. const FREE_EMAIL = /@(gmail|googlemail|yahoo|ymail|rocketmail|hotmail|outlook|live|msn|icloud|me|mac|aol|protonmail|proton|gmx|yandex|zoho)\.[a-z.]+$/i; -const PAGES = { '/': ['index.html', 'text/html; charset=utf-8'], '/logo.png': ['logo.png', 'image/png'] }; +const PAGES = { + '/': ['index.html', 'text/html; charset=utf-8'], + '/logo.png': ['logo.png', 'image/png'], + // tab icons from infinitynetworks.com.my; /favicon.ico is what browsers try when no is found + '/favicon.ico': ['favicon-32.png', 'image/png'], + '/favicon-32.png': ['favicon-32.png', 'image/png'], + '/favicon-192.png': ['favicon-192.png', 'image/png'], + '/apple-touch-icon.png': ['apple-touch-icon.png', 'image/png'], +}; // Kept identical to docs/schema.sql (a test compares the two). const SCHEMA = `CREATE TABLE IF NOT EXISTS leads ( diff --git a/server.test.js b/server.test.js index f4a6dbd..7313c7f 100644 --- a/server.test.js +++ b/server.test.js @@ -62,6 +62,14 @@ test('serves the landing page', async () => { assert.match(res.headers.get('content-type'), /text\/html/); }); +test('serves the browser tab icons', async () => { + for (const url of ['/favicon.ico', '/favicon-32.png', '/favicon-192.png', '/apple-touch-icon.png']) { + const res = await fetch(`${base}${url}`); + assert.strictEqual(res.status, 200, url); + assert.strictEqual(res.headers.get('content-type'), 'image/png', url); + } +}); + test('valid lead is stored', async () => { const res = await post(valid); assert.strictEqual(res.status, 201);