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
- https://attacomsian.com/blog/local-web-server
- https://gist.github.com/jgravois/5e73b56fa7756fd00b89
- https://medium.com/@mh_sattarian/how-to-run-a-local-server-and-more-c76dbc58d1b5
- https://tannerdolby.com/writing/build-a-minimal-http-server-with-node/
- https://runjs.app/blog/how-to-start-a-node-server