Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File not found #14

Closed
leonardop21 opened this issue Apr 26, 2019 · 13 comments
Closed

File not found #14

leonardop21 opened this issue Apr 26, 2019 · 13 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@leonardop21
Copy link

leonardop21 commented Apr 26, 2019

Hello,

I am starting the server on port 4433 as an example and pointing to the path of my project, but when accessed by the browser, I get an error of not found. What can I do wrong?

Running the local server without https the site works normally

1 Captura de Tela 2019-04-26 às 09 17 24

2 Captura de Tela 2019-04-26 às 09 18 08

@daquinoaldo
Copy link
Owner

I know that is a stupid question, but: there is an index file in that folder? If you try to append an existent file you got the same error? Like: https://localhost:4443/file.html

@leonardop21
Copy link
Author

Yes, I created a part folder with an index.html and tried to access, the same error occurred

@daquinoaldo
Copy link
Owner

I've tried to reproduce this error, without any success. I followed these steps.

  1. Uninstall https-localhost with npm -g uninstall https-localhost. which serve shouldn't print anything.
  2. Install https-localhost with npm i -g --only=prod https-localhost.
  3. mkdir test and echo "<html><body>TEST</body></html>" > test/index.html.
  4. PORT=4443 serve test. You should see "TEST" on https://localhost:4443.

I'm using macOS Mojave latest version (10.14.4), Node.js v11.14.0 and npm v6.9.0.
Can you please provide your system data?

It seems not to be a problem related to the certificate, but something related to express.js or path resolving.

@daquinoaldo daquinoaldo added bug Something isn't working help wanted Extra attention is needed labels Apr 29, 2019
@leonardop21
Copy link
Author

Hello,
Sorry for the delay, follow the tutorial above and I encountered the same problem. I tested with direct test and then passing the complete path of the directory where the file was, as print below. I will repeat the test at home with a windows pc.

Captura de Tela 2019-05-03 às 18 04 01
Captura de Tela 2019-05-03 às 18 04 12
Captura de Tela 2019-05-03 às 18 04 18

@daquinoaldo
Copy link
Owner

Could you please try to clone the repository and perform npm test?

@leonardop21
Copy link
Author

Would it be this?

Captura de Tela 2019-05-06 às 14 17 53

@daquinoaldo
Copy link
Owner

No, this error is because you have not install the dev requirements, you can install them with npm install without the --only=prod option. Then you should be able to run tests.

@leonardop21
Copy link
Author

It looks like all the tests have been completed successfully. Could it be some other program on my machine that is causing conflict?

Testing certs
✓ can be uninstalled
✓ uninstall is idempotent (doesn't fail if called twice)
Generating certificates...
Downloading the mkcert executable...
Running mkcert to generate certificates...
Certificates generated, installed and trusted. Ready to go!
✓ can be installed (19274ms)
Generating certificates...
Downloading the mkcert executable...
Running mkcert to generate certificates...
Certificates generated, installed and trusted. Ready to go!
Server running on port 4443.
✓ can be installed at first run (9300ms)
Cannot find localhost.key and localhost.crt in the specified path: does-not-exist
Server running on port 4443.
✓ crashes if certs doesn't exists in custom folder

Testing module
Server running on port 4443.
✓ works as express app
Server running on port 4443.
✓ works with environment port

Testing serve
Serving static path: test
Server running on port 4443.
✓ serves static files from custom path (55ms)
Serving static path: test
Server running on port 4443.
✓ serves static files from default env port
Serving static path: /Users/wwwjsw/Desktop/leonardo/test/https-localhost
Server running on port 4443.
✓ doesn't crash on 404 (256ms)
Serving static path: test
Server running on port 4443.
✓ looks for a 404.html file
Serving static path: does-not-exist
Server running on port 4443.
✓ doesn't crash if the static path doesn't exists

Testing additional features
http to https redirection active.
✓ redirect http to https
Serving static path: test
Server running on port 4443.
✓ is ready for production (1441ms)

14 passing (31s)

----------|----------|----------|----------|----------|-------------------|

File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 100 100 100 100
certs.js 100 100 100 100
index.js 100 100 100 100
---------- ---------- ---------- ---------- ---------- -------------------

https-localhost@4.1.0 posttest /Users/wwwjsw/Desktop/leonardo/test/https-localhost
node node_modules/nyc/bin/nyc.js report --reporter=html

@daquinoaldo
Copy link
Owner

Yes, them have been completed successfully. That is pretty strange, because there are tests with a file served on port 4443 and seem to work.
I do not exclude that could be a conflict with other programs. Any ideas?
Can you please try to run it with sudo permissions?
Have you tried it on Windows?
Thank you for your patience and your cooperation!

@leonardop21
Copy link
Author

I do not know if I can test today, but during the week I'm going to do new tests here on mac and windows, and I bring new feedback

@daquinoaldo
Copy link
Owner

Thank you very much!

@daquinoaldo
Copy link
Owner

@leonardop21 any news?

@daquinoaldo
Copy link
Owner

Feel free to open it again if you have any further information. Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants