super
1
Tell us what’s happening:
For some strange reason there is an error Cannot GET /index.html when browsing:
https://boilerplate-project-urlshortener.controlunit.repl.co/index.html
An index.html file exists in public_html.
Your code so far
https://repl.it/@controlunit/boilerplate-project-urlshortener#server.js
Your browser information:
Chromium
Challenge: URL Shortener Microservice
Link to the challenge:
Sky020
2
Hello there,
Why are you trying to go to this location?:
https://boilerplate-project-urlshortener.controlunit.repl.co/index.html
The index.html file is served with this code:
app.get('/', function(req, res){
res.sendFile(process.cwd() + '/views/index.html');
});
It is served at this location:
https://boilerplate-project-urlshortener.controlunit.repl.co
Hope this clarifies.
super
3
How can I use an index.html file from public directory?
Sky020
4
Change this code to use the public directory:
app.get('/', function(req, res){
res.sendFile(process.cwd() + '/views/index.html');
});