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