You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason I'm getting error TypeError: Object #<ServerResponse> has no method 'sendFile' at Object.handle when I try either of the above methods.
Ah. Had an older of express installed (maybe based on the package.json file from repository. Express docs
Note: res.sendFile requires Express version to be at least 4.8.0
TheSachinSBhat
added a commit
to TheSachinSBhat/chat-example-1
that referenced
this issue
Feb 7, 2017
The tutorial is inconsistent about using
res.sendfile
orres.sendFile
. Ifres.sendFile
is used (sincesendfile
is deprecated), usingres.sendFile('index.html');
doesn't work, throwing an error about the path not being specified properly. Here's what I did to fix it:
res.sendFile(__dirname + '/index.html');
The text was updated successfully, but these errors were encountered: