31 décembre 2023

Localhost

Several light solutions for running a local HTTP server.

Python

python -V
# or
python3 -V

Python 2

cd /path/to/directory
python -m SimpleHTTPServer <port>

Python 3

python3 -m http.server <port> --directory /path/to/directory

Julia

First you need to install LiveServer. Just enter following command int the the repl:

pkg> add LiveServer

Repl

julia> using LiveServer
julia> serve(host="0.0.0.0", port=8001, dir=".")

Terminal

julia -e 'using LiveServer; serve(host="0.0.0.0", port=8001, dir=".")'

NB

see also HTTP.jl package

PHP

voir documentation

NodeJS

Lectures complémentaires