craigtsmith / sinatra-static-web

A trivial Sinatra-based web server, strictly for static content.

Home Page:http://simplewebrb.cloudfoundry.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SimpleWeb

A trivial app to demonstrate serving of static content using the Sinatra framework in Ruby.

Some sample / placeholder content is provided (styled with Bootstrap) but the expectation is that the user will replace the contents of the public directory with files for static serving by the Ruby app.

Read more about the motivation for this on my blog.

Overview

This example uses:

Deployment

What are all these files?

Nothing, really. No, really. Everything in the public folder is there as a placeholder. All you need to get going is the web.rb file (well, OK, you need the Gemfile and config.ru too).

Put your own static web content (with an index.html file, and maybe a 404.html file) in the public folder, and either:

  • run bundle install then rackup from the root directory; or
  • deploy to Cloud Foundry as a Rack/Sinatra application

... and you are good to go.

Optionally, fiddle with the settings in the top of the web.rb file to tweak how things work.

There is an example Cloud Foundry manifest.yml(.example) file - if you wish to use this for one-push deployment, rename to manifest.yml and edit the name of the application to be something unique for your Cloud Foundry installation, or the push will fail.

About

A trivial Sinatra-based web server, strictly for static content.

http://simplewebrb.cloudfoundry.com

License:Apache License 2.0


Languages

Language:HTML 37.3%Language:CSS 32.9%Language:JavaScript 24.4%Language:Ruby 5.4%