mirror of
https://github.com/SrIzan10/starters.git
synced 2026-05-01 11:05:16 +00:00
Sinatra example (#51)
This commit is contained in:
@@ -16,7 +16,7 @@ This is a [Ruby on Rails](https://rubyonrails.org/) blog that connects to a Rail
|
||||
- Connect to your Railway project with `railway init`
|
||||
- Install Ruby requirements `bundle install`
|
||||
- Migrate the database `railway run rake db:migrate`
|
||||
- Run Django `railway run bin/rails migrate`
|
||||
- Run Rails `railway run bin/rails migrate`
|
||||
|
||||
## 📝 Notes
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Rails Example
|
||||
# Rails Starter Example
|
||||
|
||||
This is a [Ruby on Rails](https://rubyonrails.org/) starter app that connects to a Railway Postgres database.
|
||||
|
||||
@@ -16,7 +16,7 @@ This is a [Ruby on Rails](https://rubyonrails.org/) starter app that connects to
|
||||
- Connect to your Railway project with `railway init`
|
||||
- Install Ruby requirements `bundle install`
|
||||
- Migrate the database `railway run rake db:migrate`
|
||||
- Run Django `railway run bin/rails migrate`
|
||||
- Run Rails `railway run bin/rails migrate`
|
||||
|
||||
## 📝 Notes
|
||||
|
||||
|
||||
36
examples/sinatra/.gitignore
vendored
Normal file
36
examples/sinatra/.gitignore
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
||||
#
|
||||
# If you find yourself ignoring temporary files generated by your text editor
|
||||
# or operating system, you probably want to add a global ignore instead:
|
||||
# git config --global core.excludesfile '~/.gitignore_global'
|
||||
|
||||
# Ignore bundler config.
|
||||
/.bundle
|
||||
|
||||
# Ignore all logfiles and tempfiles.
|
||||
/log/*
|
||||
/tmp/*
|
||||
!/log/.keep
|
||||
!/tmp/.keep
|
||||
|
||||
# Ignore pidfiles, but keep the directory.
|
||||
/tmp/pids/*
|
||||
!/tmp/pids/
|
||||
!/tmp/pids/.keep
|
||||
|
||||
# Ignore uploaded files in development.
|
||||
/storage/*
|
||||
!/storage/.keep
|
||||
|
||||
/public/assets
|
||||
.byebug_history
|
||||
|
||||
# Ignore master key for decrypting credentials and more.
|
||||
/config/master.key
|
||||
|
||||
/public/packs
|
||||
/public/packs-test
|
||||
/node_modules
|
||||
/yarn-error.log
|
||||
yarn-debug.log*
|
||||
.yarn-integrity
|
||||
6
examples/sinatra/Gemfile
Normal file
6
examples/sinatra/Gemfile
Normal file
@@ -0,0 +1,6 @@
|
||||
source 'https://rubygems.org'
|
||||
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||
|
||||
ruby '2.7.2'
|
||||
|
||||
gem 'sinatra'
|
||||
27
examples/sinatra/Gemfile.lock
Normal file
27
examples/sinatra/Gemfile.lock
Normal file
@@ -0,0 +1,27 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
mustermann (1.1.1)
|
||||
ruby2_keywords (~> 0.0.1)
|
||||
rack (2.2.3)
|
||||
rack-protection (2.1.0)
|
||||
rack
|
||||
ruby2_keywords (0.0.4)
|
||||
sinatra (2.1.0)
|
||||
mustermann (~> 1.0)
|
||||
rack (~> 2.2)
|
||||
rack-protection (= 2.1.0)
|
||||
tilt (~> 2.0)
|
||||
tilt (2.0.10)
|
||||
|
||||
PLATFORMS
|
||||
x86_64-darwin-20
|
||||
|
||||
DEPENDENCIES
|
||||
sinatra
|
||||
|
||||
RUBY VERSION
|
||||
ruby 2.7.2p137
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.8
|
||||
1
examples/sinatra/Procfile
Normal file
1
examples/sinatra/Procfile
Normal file
@@ -0,0 +1 @@
|
||||
web: ruby app.rb
|
||||
16
examples/sinatra/README.md
Normal file
16
examples/sinatra/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Sinatra Example
|
||||
|
||||
This example is a simple [Sinatra](http://sinatrarb.com) webserver.
|
||||
|
||||
[](https://railway.app/new?template=https%3A%2F%2Fgithub.com%2Frailwayapp%2Fexamples%2Ftree%2Fmaster%2Fexamples%2Fsinatra)
|
||||
|
||||
## ✨ Features
|
||||
|
||||
- Ruby
|
||||
- Sinatra
|
||||
|
||||
## 💁♀️ How to use
|
||||
|
||||
- Create Railway project `railway init`
|
||||
- Install Ruby requirements `bundle install`
|
||||
- Run Sinatra `railway run ruby app.rb`
|
||||
5
examples/sinatra/app.rb
Normal file
5
examples/sinatra/app.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'sinatra'
|
||||
|
||||
get '/' do
|
||||
'Choo Choo! Welcome to your Sinatra server 🚅'
|
||||
end
|
||||
@@ -47,7 +47,7 @@
|
||||
"value": "rocket-rust",
|
||||
"desc": "Fast webserver written in Rust",
|
||||
"href": "https://github.com/railwayapp/examples/tree/master/examples/rocket",
|
||||
"icon": "rust.svg",
|
||||
"icon": "rocket.svg",
|
||||
"tags": ["rust"]
|
||||
},
|
||||
{
|
||||
@@ -68,6 +68,14 @@
|
||||
"icon": "rails.svg",
|
||||
"tags": ["ruby"]
|
||||
},
|
||||
{
|
||||
"text": "Sinatra",
|
||||
"value": "sinatra",
|
||||
"desc": "Lightweight Ruby server",
|
||||
"href": "https://github.com/railwayapp/examples/tree/master/examples/sinatra",
|
||||
"icon": "rails.svg",
|
||||
"tags": ["ruby"]
|
||||
},
|
||||
{
|
||||
"text": "Django Starter",
|
||||
"value": "django",
|
||||
|
||||
BIN
icons/rocket.png
Normal file
BIN
icons/rocket.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
Reference in New Issue
Block a user