Skip to content

Instantly share code, notes, and snippets.

@saboyutaka
Created May 21, 2018 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saboyutaka/1965df72c70ec7a4d446e35cd4a03d82 to your computer and use it in GitHub Desktop.
Save saboyutaka/1965df72c70ec7a4d446e35cd4a03d82 to your computer and use it in GitHub Desktop.
sinatra static files
require 'sinatra'
require 'sinatra/reloader'
set :public_folder, File.dirname(__FILE__) + '/public'
get '/' do
erb :index
end
<h1>Hello, Sinatra!</h1>
<p><%= 'hello' * 5 %></p>
<!doctype html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="/css/style.css">
<script type="text/javascript" src="/js/app.js"></script>
</head>
<body>
<%= yield %>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment