Click here to Skip to main content
15,917,795 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
server.route({
method:'GET',
path:'/about',
handler:(request,h)=> {

return h.file('C:/Users/AAKASH/Desktop/New folder/hapiapp/public/to/about');
}

What I have tried:

sir my html file is not showing on webpage, i think it is of path mistake by me, is it so?
Posted
Updated 11-Mar-18 23:51pm

1 solution

Hi,

Use path npm module instead of "C:/Users/...about.html" something like as below line

JavaScript
server.route({
    method:'GET',
    path:'/about',
    handler:(request,h)=> {
      return h.file(path.join(__dirname, '..', 'public', 'about.html'));
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900