How to view HTML files in your browser with the hostname localhost [Closed]

Asked 2 years ago, Updated 2 years ago, 64 views

Do you want to improve this question?Edit your post to clarify the issue you are trying to resolve by adding details.

Closed 5 years ago.

5 years ago

How do I view index.html in my browser using localhost?

html http

2022-09-30 19:26

1 Answers

Python is the fastest way to set up a local server for development.
Python 2 uses SimpleHTTPServer.

$python-m SimpleHTTPServer

Python 3 uses http.server.

$python3-m http.server

If you omit the port number, 8000 will be used, so accessing http://localhost:8000 (or simply localhost:8000) from your browser will start the server as root.


2022-09-30 19:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.