Skip to content

Instantly share code, notes, and snippets.

@mikoloism
Last active April 25, 2021 15:33
Show Gist options
  • Save mikoloism/c56d25908b1b658dbcb8ca2dba6f5598 to your computer and use it in GitHub Desktop.
Save mikoloism/c56d25908b1b658dbcb8ca2dba6f5598 to your computer and use it in GitHub Desktop.
how create localhost with programming language CLI

How create a localhost

How create a localhost from current directory with custom port

Using with Programming CLI and Builts Apps in any system

With Python

  • code :

    $ python -m SimpleHTTPServer 8080 # or any port number you want to be
  • usage :

    • click localhost
    • Or, open web-browser (firefox, chrome, etc.)
    • write localhost:8080 at the address-bar

    Using PHP

  • code :

    $ php -S localhost:8000 # or any port number you want to be
  • usage :

    • click localhost
    • Or, open web-browser (firefox, chrome, etc.)
    • write localhost:8080 at the address-bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment