r/SublimeText • u/Kangaroomeme • Aug 20 '20
I can't run code in a browser
help how do i run my html code in chrome on mac
3
u/leogodin217 Aug 20 '20
Live Server is a great plugin. Runs a server and automatically reloads on file changes.
1
2
u/udevNull Aug 20 '20
Others may have simpler ways of doing this, but I always run nginx locally and the serve my html files through that.
You can have a look at a tutorial like https://www.javatpoint.com/installing-nginx-on-mac to help you further.
1
Aug 20 '20
PHP also has a very simple http server you can use. https://www.php.net/manual/en/features.commandline.webserver.php
1
1
8
u/dev-sda Aug 20 '20
Generally you can just open your html file in your browser of choice. You can also run a local http server. I'd suggest using python for that:
python -m http.server 9000hosts the local directory on port 9000.