Coder Social home page Coder Social logo

leonardo's Introduction

The Leonardo Web Server

This is Leonardo, a web server written in Jolie.

You can use Leonardo as is, to host static files, or as a powerful server-generated pages framework. The implementation of server-generated pages is left to the user, by using hooks (defined as Jolie services). See Fabrizio's website for an example using templates and external services.

Leonardo uses plain HTTP for serving content. To add encryption (HTTPS), we recommend combining it with a reverse proxy (for example, we like linuxserver/letsencrypt).

Start quickly with Docker for static content

If you have Docker installed and you just want to host some static content, using Leonardo is really quick. First, pull the image from Docker Hub: docker pull jolielang/leonardo. Assume that you have your static content in directory myWWW (replace this with your actual directory), then you can just run the following command and Leonardo will start.

docker run -it --rm -v "$(pwd)"/myWWW:/web -e LEONARDO_WWW=/web -p 8080:8080 jolielang/leonardo

Go ahead and browse http://localhost:8080/.

Static content

If you simply want to use Leonardo to host some static content, you can run it as it is.

You just have to tell Leonardo where the static content is located. You can do it in two ways:

  • Pass the content directory as an argument. For example, if your content is in /var/www, then you should run the command jolie launcher.ol /var/www.
  • Pass the content directory by using the environment variable LEONARDO_WWW. In this case, you just need to invoke jolie launcher.ol.

Make a Docker image with your own website

Here is a Dockerfile that creates an image for a website whose content is stored in directory myWWW.

FROM jolielang/leonardo
ENV LEONARDO_WWW /web
COPY myWWW $LEONARDO_WWW
EXPOSE 8080

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.