raddevon
raddevon

Reputation: 3360

grunt-contrib-connect not serving files from my specified base

I have a very simple configuration for grunt-contribu-connect in my Gruntfile.

connect: {
  dev: {
    base: 'dist'
  }
},

The task runs and is kept alive by my watch task, but, whenever I try to open a page from this base directory, I get error output instead of the desired page.

Cannot GET /odds.html

In this image, you can see my project structure. The Gruntfile is at the project base, and the odds.html file I want to open is in the dist folder relative to that.

Project folder and file structure

Here, you can see the error along with the URI I'm trying to hit.

Browser with the error message

I'm sure I'm overlooking something silly, but I cannot see it. Please help! Thanks.

Upvotes: 1

Views: 4281

Answers (1)

eqot
eqot

Reputation: 671

I believe that you need to add 'options' and/or 'keepalive' as follows.

connect: {
  dev: {
    options: {
      base: 'dist',
      keepalive: true
    }
  }
},

I hope this helps you.

Upvotes: 10

Related Questions