GithubHelp home page GithubHelp logo

activelabs / sinatra-hello-world Goto Github PK

View Code? Open in Web Editor NEW

This project forked from garethr/sinatra-hello-world

1.0 2.0 1.0 94 KB

A Hello World style application demonstrating the Sinatra Ruby framework

sinatra-hello-world's Introduction

Introduction

This here application is a glorified Hello World using the Sinatra Ruby web framework. If you’re thinking that a hello world example doesn’t need a test suite, logging, configuration for multiple web servers and code that will restart it if it runs too hot, you’d be right.

Running

Much of the code included in this example application is concerned with configuration for deploying with various other ruby tools.

Sinatra

Sinatra comes with it’s own web server.

./app.rb

Thin

Alternatively you can use an instance of Thin.

thin -C configs/config.yml -R configs/config.ru start
thin -C configs/config.yml -R configs/config.ru stop

God

If you’re feeling particularly fancy then you can keep the Thin server up and running with God.

First start the god daemon:

sudo god
sudo status

Then load your configuration and start the monitor:

sudo god load thin-sinatra-hello-world
sudo god monitor thin-sinatra-hello-world

Then run a few commands to demonstrate everything is in running order.

sudo status
sudo god start thin-sinatra-hello-world
sudo god stop thin-sinatra-hello-world

Testing

So far you run a few very simple tests, either with unittest or with RSpec.

To run the unit tests simply run:

rake

To run the RSpec tests run:

rake spec

sinatra-hello-world's People

Contributors

garethr avatar

Watchers

James Cloos avatar  avatar

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.