Serving static files with Sinatra

You can use the send_file helper to serve files. require ‘sinatra’ get “https://stackoverflow.com/” do send_file File.join(settings.public_folder, ‘index.html’) end This will serve index.html from whatever directory has been configured as having your application’s static files.

Gem installation error: You have to install development tools first (Windows)

Also for Mac: if you do not already have xcode dev tools installed on your system (perhaps you recently upgraded your OS or Xcode), run xcode-select –install otherwise, a more invasive fix is to set the active directory using the –switch flag sudo xcode-select –switch / from the xcode-select manual: -s <path>, –switch <path> Sets … Read more

Separate REST JSON API server and client? [closed]

At Boundless, we’ve gone deep with option #2 and rolled it out to thousands of students. Our server is a JSON REST API (Scala + MongoDB), and all of our client code is served straight out of CloudFront (ie: www.boundless.com is just an alias for CloudFront). Pros: Cutting-edge/exciting A lot of bang for your buck: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)