Sjark
Sjark

Reputation: 85

Grunt serve, make root a subfolder

Is it possible to make the root of grunt serve be a subfolder.

Instead of localhost:9000 is the root, I want localhost:9000/wz27 to be the root.

This is to make the page behave just like it will when it is published online.

Upvotes: 0

Views: 346

Answers (1)

hereandnow78
hereandnow78

Reputation: 14434

use grunt-contrib-connect where you are able to define an option base, which is

The base (or root) directory from which files will be served. Defaults to the project Gruntfile's directory.

eg:

grunt.initConfig({
  connect: {
    server: {
      options: {
        base: 'wz27'
        port: 9000
      }
    }
  }
});

Upvotes: 1

Related Questions