Grunt 403 forbidden error

dylanjha

I'm using node and grunt for an existing JS project I cloned from github.

npm install
grunt

Grunt launches my browser to localhost:8000 and opens the index page.

The index page loads, but I'm getting all 403 errors when the browsers tries to fetch the assets

Error: Forbidden
at SendStream.error (/Users/dylanjhaveri/code/skeuocard/node_modules/grunt-express/node_modules/connect/node_modules/send/lib/send.js:145:16)
at SendStream.pipe (/Users/dylanjhaveri/code/skeuocard/node_modules/grunt-express/node_modules/connect/node_modules/send/lib/send.js:310:52)
at Object.static (/Users/dylanjhaveri/code/skeuocard/node_modules/grunt-express/node_modules/connect/lib/middleware/static.js:84:8)
at next (/Users/dylanjhaveri/code/skeuocard/node_modules/grunt-express/node_modules/connect/lib/proto.js:190:15)
at Function.app.handle (/Users/dylanjhaveri/code/skeuocard/node_modules/grunt-express/node_modules/connect/lib/proto.js:198:3)
at Server.app (/Users/dylanjhaveri/code/skeuocard/node_modules/grunt-express/node_modules/connect/lib/connect.js:65:37)
at Server.EventEmitter.emit (events.js:98:17)
at HTTPParser.parser.onIncoming (http.js:2108:12)
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:121:23)
at Socket.socket.ondata (http.js:1966:22)
dylanjha

The fix was this: in Gruntfile.coffee:

Change this:

express:
  all:
    options:
      port: 8000
      hostname: "0.0.0.0"
      bases: ['.']

to this:

express:
  all:
    options:
      port: 8000
      hostname: "0.0.0.0"
      bases: [__dirname]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related