All Projects → tlienart → LiveServer.jl

tlienart / LiveServer.jl

Licence: other
Simple development server with live-reload capability for Julia.

Programming Languages

julia
2034 projects
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to LiveServer.jl

vscode-live-server-plus-plus
VsCode Live Server++ : It's Truly Live 😊 (BETA) -- [NOT RELEASED YET]
Stars: ✭ 198 (+144.44%)
Mutual labels:  live-server
irc-tts
Broadcast your IRC channel via a text-to-speech webserver
Stars: ✭ 14 (-82.72%)
Mutual labels:  webserver
pLannotate
Webserver and command line tool for annotating engineered plasmids
Stars: ✭ 32 (-60.49%)
Mutual labels:  webserver
Kitura-HelloWorld-iOS
A Hello World example of running Kitura on iOS
Stars: ✭ 55 (-32.1%)
Mutual labels:  webserver
MemoBoard
Flask and React based intranet app where you can create and share lists (e.g. shopping list, todo, ...)
Stars: ✭ 35 (-56.79%)
Mutual labels:  webserver
toh
TCP over HTTP. 隐藏网站的管理服务
Stars: ✭ 36 (-55.56%)
Mutual labels:  webserver
ruby wolf
Tiny ruby web server for research and studying purpose
Stars: ✭ 19 (-76.54%)
Mutual labels:  webserver
ferver
A Ruby gem to serve files over HTTP, packaged as a Ruby gem
Stars: ✭ 14 (-82.72%)
Mutual labels:  webserver
django-boilerplate-3.6.1
Django served by Gunicorn running behind Nginx reverse proxy. Deploy to AWS Elastic Beanstalk with Fabric3!
Stars: ✭ 13 (-83.95%)
Mutual labels:  webserver
docker-apache-letsencrypt
This docker-image contains a simple Apache webserver and supports https-encryption by great Let's Encrypt certificates!
Stars: ✭ 65 (-19.75%)
Mutual labels:  webserver
WebListener
A simple, lightweight, PowerShell-based web server, designed for small, temporary projects.
Stars: ✭ 29 (-64.2%)
Mutual labels:  webserver
rust-web-boilerplate
An implementation of a simple web server using Rust
Stars: ✭ 36 (-55.56%)
Mutual labels:  webserver
simplewebserver
SimpleWebServer 是一款使用Java基于NIO编写的超轻量级开源Web Application Server
Stars: ✭ 67 (-17.28%)
Mutual labels:  webserver
internetarchivebot
iabot.toolforge.org
Stars: ✭ 67 (-17.28%)
Mutual labels:  webserver
salt
**Unmaintained** A Human Friendly Interface for HTTP server written in Crystal.
Stars: ✭ 19 (-76.54%)
Mutual labels:  webserver
go-echo-server-sandbox
A scaffold of golang web server using labstack/echo
Stars: ✭ 12 (-85.19%)
Mutual labels:  webserver
cordova-plugin-webserver
A webserver plugin for cordova
Stars: ✭ 101 (+24.69%)
Mutual labels:  webserver
quickserv
Dangerously user-friendly web server for quick prototyping and hackathons
Stars: ✭ 275 (+239.51%)
Mutual labels:  webserver
Fos
FastCgi Server designed to run Owin applications side by side with a FastCgi enabled web server.
Stars: ✭ 65 (-19.75%)
Mutual labels:  webserver
ESPxWebFlMgr
Manage your ESP8266/ESP32 SPIFFS/LittleFS files with a simple web based interface
Stars: ✭ 33 (-59.26%)
Mutual labels:  webserver

Live Server for Julia

CI Actions Status codecov dev-doc

This is a simple and lightweight development web-server written in Julia, based on HTTP.jl. It has live-reload capability, i.e. when modifying a file, every browser (tab) currently displaying the corresponding page is automatically refreshed.

LiveServer is inspired from Python's http.server and Node's browsersync.

Installation

To install it in Julia ≥ 1.3, use the package manager with

pkg> add LiveServer

For Julia [1.0, 1.3), you can use LiveServer's version 0.7.4:

Make it a shell command

LiveServer is a small package and fast to load with one main functionality (serve), it can be convenient to make it a shell command: (I'm using the name lss here but you could use something else):

alias lss='julia -e "import LiveServer as LS; LS.serve(launch_browser=true)"'

you can then use lss in any directory to show a directory listing in your browser, and if the directory has an index.html then that will be rendered in your browser.

Usage

The main function LiveServer exports is serve which starts listening to the current folder and makes its content available to a browser. The following code creates an example directory and serves it:

julia> using LiveServer
julia> LiveServer.example() # creates an "example/" folder with some files
julia> cd("example")
julia> serve() # starts the local server & the file watching
✓ LiveServer listening on http://localhost:8000/ ...
  (use CTRL+C to shut down)

Open a Browser and go to http://localhost:8000/ to see the content being rendered; try modifying files (e.g. index.html) and watch the changes being rendered immediately in the browser.

In the REPL:

julia> using LiveServer
julia> serve(host="0.0.0.0", port=8001, dir=".") # starts the remote server & the file watching
✓ LiveServer listening on http://0.0.0.0:8001...
  (use CTRL+C to shut down)

In the terminal:

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

Open a browser and go to https://localhost:8001/ to see the rendered content of index.html or, if it doesn't exist, the content of the directory. You can set the port to a custom number. This is similar to the http.server in Python.

Serve docs

servedocs is a convenience function that runs Documenter along with LiveServer to watch your doc files for any changes and render them in your browser when modifications are detected.

Assuming you are in directory/to/YourPackage.jl, that you have a docs/ folder as prescribed by Documenter.jl and LiveServer installed in your global environment, you can run:

$ julia

pkg> activate docs

julia> using YourPackage, LiveServer

julia> servedocs()
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: ExpandTemplates: expanding markdown templates.
...
└ Deploying: ✘
✓ LiveServer listening on http://localhost:8000/ ...
  (use CTRL+C to shut down)

Open a browser and go to http://localhost:8000/ to see your docs being rendered; try modifying files (e.g. docs/index.md) and watch the changes being rendered in the browser.

To run the server with one line of code, run:

$ julia --project=docs -ie 'using YourPackage, LiveServer; servedocs()'

Note: this works with Literate.jl as well. See the docs.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].