2

My Gruntfile:

...
connect: {
  server: {
    options: {
      port: 8000,
      hostname: 'localhost',
      base: '.'
    }
  }
}
...

Then, when I run grunt connect, I see this:

❯ grunt connect
  Running "connect:server" (connect) task
  Started connect web server on http://localhost:8000

  Done, without errors.
❯

Then that's it. If I got to my localhost:8000. I see chrome can't connect.

dylanjha
  • 2,303
  • 4
  • 28
  • 47

1 Answers1

3

If you want to use grunt-contrib-connect as a dev server, please look at keepalive option.

According to the documentation:

Note that this server only runs as long as grunt is running. Once grunt's tasks have completed, the web server stops. This behavior can be changed with the keepalive option, and can be enabled ad-hoc by running the task like grunt connect:keepalive.

raidendev
  • 2,729
  • 1
  • 22
  • 23