From 66f919280e00f0d1c45f5155a133634c547722f0 Mon Sep 17 00:00:00 2001 From: Koji Takami Date: Mon, 9 May 2016 16:43:34 +0900 Subject: [PATCH] Raise the main browser on npm start --- README.md | 9 +++++++-- bin/www | 4 ++++ package.json | 8 ++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3644eb25..631b478c 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,13 @@ $ npm start > node ./bin/www ``` -Then, open a http://localhost:3000/MZ-700/client.html with your browser. -But this does not work with the Microsoft Edge. +Then, the client emulation page is being served as an URL +[http://localhost:3000/MZ-700/client.html](http://localhost:3000/MZ-700/client.html). +The page will be opened in automatically with your main browser. +Ofcource, you can use another one instead in manually. + +The browser requires the features of HTML5. +But, it __does not work with the Microsoft Edge__. LICENCE diff --git a/bin/www b/bin/www index 9d24840d..f86ed9b4 100644 --- a/bin/www +++ b/bin/www @@ -87,4 +87,8 @@ function onListening() { ? 'pipe ' + addr : 'port ' + addr.port; debug('Listening on ' + bind); + + /* Open the page */ + const opn = require('opn'); + opn('http://localhost:3000/MZ-700/client.html'); } diff --git a/package.json b/package.json index d051a7c4..be08820a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mz700-js", - "version": "0.0.3", + "version": "0.0.4", "description": "Full JavaScript MZ-700 Emulator", "private": false, "scripts": { @@ -16,6 +16,7 @@ "list-it": "^0.3.3", "morgan": "~1.6.1", "node-getopt": "^0.2.3", + "opn": "^4.0.1", "serve-favicon": "~2.3.0" }, "devDependencies": { @@ -26,7 +27,10 @@ "url": "git+https://github.com/takamin/mz700-js.git" }, "keywords": [ - "emulator", "MZ-700", "MZ700", "Z80" + "emulator", + "MZ-700", + "MZ700", + "Z80" ], "author": "Koji Takami", "license": "MIT",