How do I link to other pages from index.html
Projects in HyperDev arenât special in any way, so you link to files like you normally would with an anchor tag. So for example in our tutorial project https://hyperdev.com/#!/project/denim-warlock in index.html youâll see the line â<a href="/exercise1.html">â, that links to another page âexercise1.htmlâ in the same project. You can add new files to your own projects by clicking the â+â sign next to âfront-endâ in the left-hand side file menu, typing the name and hitting enter.
I tried that but continue to receive the following Cannot GET /NewPage.html error. Is there anything else that needs to be configured? I have tried href="/views/NewPage.html", href="/NewPage.html" etc.
(Yes the html page is created in the project)
Resolved
You need to add routing
response.sendFile(__dirname + '/views/NewPage.html');
});```
If the pages are under public/NewPage.html and you have express serving static assets with app.use(express.static('public')); then it should âjust workâ. If your pages are in views or another directory then youâll need to explicitly create routes for them.
I hope this clears it up 
I ran into the same problem and this Q&A helped me - thanks. I just wanted to point out that by default when you add a page using the â+â sign next to âfront-endâ in the left-hand side file menu, typing the name and hitting enter, the new page ends up under the views directory, not the public directory. So you need to add the routing to fix the âCannot GETâ error.
express.static was in my server.js file by default, however I still got the GET error. What I didnât understand was that my pages needed to be saved as public/newpage.html instead views/newpage.html. Iâm used to thinking that pages go alongside wherever index.html is, and thatâs not true here.
All good now thoâ
They donât have to be in any particular directory, they just have to be in the place youâve configured them to be in Express. So if youâve used app.use(express.static('public')) then theyâd need to go in the public folder, but you could switch that to be views or root.
Thanks for the clarification Gareth.
Can someone explain? Simpler. Iâm new to HTML
If you go to the file called server.js, you will see a line of code that ends inâŚ
app.use(express.static(âpublicâ));
check where you have saved the file that you wish to link to - if you used the default offered to you, then you may well have saved your file in the views folder, you will see it looks like this in the list of files in the sidenav⌠eg . views/cool-file
If you have saved your file in views, then you will need to alter the line of code in server.js to point to âviewsâ instead of âpublicâ, so you need to alter your line of code in server.js to look like this
âŚ
app.use(express.static(âviewsâ));
(notice the word in between the brackets is no longer âpublicâ instead it now reads âviewsâ)
now in your html link to your file use href=âcool-file.htmlâ
and it will workâŚ
(the alternative is to leave the server.js code as it is - eg pointing to the public file, and then save your cool-file there instead.)
Thank You For This Clarity Info.