jsoverson / grunt-open

Open urls and files from a grunt task
MIT License
110 stars 19 forks source link

Open html file using Grunt open #20

Open mehmedju opened 10 years ago

mehmedju commented 10 years ago

I made grunt open task on the next way: module.exports = function(grunt) {

grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), open : {

        AngularSeedApp : {
            path: 'http://127.0.0.1:8888/app/index.html',
            //app: 'Google Chrome'
        },

}); grunt.loadNpmTasks('grunt-open');

After this I run in command line: grunt open and chrome runs and I got this Oops! Google Chrome could not connect to 127.0.0.1:8888

Try reloading: 127.­0.­0.­1:­8888/­app/­index.­html

How I can solve this issue that I get my preview of index.html in browser (chrome is my default).

jsoverson commented 10 years ago

Nothing seems to be running on port 8888 of your local machine, you need to be pointing it to a url you can reasonably expect something to exist at. If grunt is also spinning up a server, then you need to make sure the server is started before the open task is called.