This is a simple static site example made for the Gleis PaaS using the Rack webserver interface. Its purpose is to show that one can also use the Gleis platform to easily and quickly deploy a static site which does not have any application logic but just consists of HTML, CSS, Javascript and image files.
In order to run this example static site locally you will need Ruby along with the Bundler gem to be installed on your computer. As soon as you are ready to deploy you will need an account on the Gleis PaaS as well as the Gleis CLI Ruby gem.
Download your own copy of this example static site:
$ git clone git@github.com:towards/static-example.git
$ cd static-example
Install the dependencies:
$ bundle
Start the server:
$ rackup
The example static site should now be reachable locally on your computer at http://localhost:9292
Create new app on Gleis:
$ gleis app create
Upload site to Gleis:
$ git push gleis master
The example site will be online in a few seconds and reachable through the secure URL mentioned when you created the Gleis app with the above command.
- If you would like to add a new page to your static site simply create a new directory inside the
public
directory and add anindex.html
file. - Image, Javascript and stylesheet files should be stored in their respective directory under the
public/assets
directory. - Browser caching of static assets is set to 10 days.
- For a more complex site try the Jekyll static site generator which can then also be deployed to Gleis.