Skip to content

Instantly share code, notes, and snippets.

@kdv24
Last active March 7, 2016 00:52
Show Gist options
  • Save kdv24/964b65080378d7fc319f to your computer and use it in GitHub Desktop.
Save kdv24/964b65080378d7fc319f to your computer and use it in GitHub Desktop.
simple sinatra setup

File structure:

  • Project Folder
    • Gemfile

      source('https://rubygems.org')
      
      gem('sinatra')
      gem('sinatra-contrib') 
      
    • app.rb (holds all logic)

      require('sinatra')
      require('sinatra/reloader')
      
    • public/

      • images (unsplash.com has free pics and easy api)
      • css
      • js

Run bundle in app's root folder (always after installing new gem or adding 'require' and Gemfile.lock will be created

Run ruby app.rb in app's root folder to start Sinatra server- use name of file with all app logic

Have to restart server to see changes in code take effect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment