gruntjs / grunt-contrib-connect

Start a static web server.
http://gruntjs.com
MIT License
714 stars 146 forks source link

Only root is reachable, only on CI server #149

Closed ryanbillingsley closed 9 years ago

ryanbillingsley commented 9 years ago

I have been beating my head against a wall trying to figure out what is going on and I am hoping that someone can help.

I am using grunt-contrib-connect to start up a static server to run mocha specs against using selenium. Locally on OS X 10.10, everything works perfectly. Wonderful.

However, on the CI (Semaphore), the server starts, the specs start running, the first spec which hits / passes without problems. However, the next specs that are connection to /path/to/html/ all fail. I threw some curl requests to see if maybe it was just a testing issue, I can curl http://localhost:3023 works fine, curl http://localhost:3023/path/to/html/ 404s. The files are exactly where they should be and like I said, this all works on my local machine.

Any ideas what could be happening? Here is my grunt config:

        connect: {
            options: {
                port: 4000,
                hostname: 'localhost',
                livereload: 35729
            },
            livereload: {
                options: {
                    middleware: function(connect) {
                        return [
                            // Load the middleware provided by the livereload plugin
                            // that will take care of inserting the snippet
                            require('grunt-contrib-livereload/lib/utils').livereloadSnippet,
                            connect.bodyParser(),
                            connect.static(paths.dist.root)
                        ];
                    }
                }
            },
            test: {
                options: {
                    port: 3023,
                    host: '*',
                    base: paths.dist.root,
                    livereload: false,
                    debug: true,
                    directory: paths.dist.root,
                    middleware: function(connect) {
                        return [
                            connect.static(paths.dist.root)
                        ];
                    }
                }
            },
            dist: {
                options: {
                    port: 1338,
                    open: 'http://localhost:1338/',
                    base: paths.dist.root,
                    livereload: false,
                    keepalive: true
                }
            }
        },

I am calling connect:test for the testing task. Any help would be greatly appreciated.

sindresorhus commented 9 years ago

Support questions are better asked on StackOverflow: http://stackoverflow.com/questions/tagged/gruntjs Paste in the link to the question here so others can follow ;)

ryanbillingsley commented 9 years ago

Here is the question https://stackoverflow.com/questions/26847560/grunt-contrib-connect-only-root-is-reachable-only-on-ci-server