Added started adding some Sinatra app stuff

This commit is contained in:
Gregory Ballantine 2023-07-02 23:42:24 -04:00
parent f599a3b9fa
commit b376bf3a79
8 changed files with 71 additions and 1 deletions

6
Gemfile Normal file
View File

@ -0,0 +1,6 @@
source 'https://rubygems.org'
gem 'sinatra', '~> 3.0'
gem 'sinatra-contrib', '~> 3.0'
gem 'puma', '~> 6.3'

36
Gemfile.lock Normal file
View File

@ -0,0 +1,36 @@
GEM
remote: https://rubygems.org/
specs:
multi_json (1.15.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
nio4r (2.5.9)
puma (6.3.0)
nio4r (~> 2.0)
rack (2.2.7)
rack-protection (3.0.6)
rack
ruby2_keywords (0.0.5)
sinatra (3.0.6)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
rack-protection (= 3.0.6)
tilt (~> 2.0)
sinatra-contrib (3.0.6)
multi_json
mustermann (~> 3.0)
rack-protection (= 3.0.6)
sinatra (= 3.0.6)
tilt (~> 2.0)
tilt (2.2.0)
PLATFORMS
x86_64-linux
DEPENDENCIES
puma (~> 6.3)
sinatra (~> 3.0)
sinatra-contrib (~> 3.0)
BUNDLED WITH
2.3.5

View File

@ -1,4 +1,4 @@
Copyright (c) <year> <owner> Copyright (c) 2023 Bit Goblin
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

8
Rakefile Normal file
View File

@ -0,0 +1,8 @@
require 'bundler/setup'
namespace :server do
task :start do
system("puma")
end
end

3
config.ru Normal file
View File

@ -0,0 +1,3 @@
root = ::File.dirname(__FILE__)
require ::File.join( root, 'server' )
run GameData.new

9
server.rb Executable file
View File

@ -0,0 +1,9 @@
require 'sinatra/base'
# Base app
class GameData < Sinatra::Base
enable :sessions
end
# Load routes
require_relative 'src/routes/init'

7
src/routes/index.rb Normal file
View File

@ -0,0 +1,7 @@
class GameData < Sinatra::Base
get '/' do
return 'Test.'
end
# more routes...
end

1
src/routes/init.rb Normal file
View File

@ -0,0 +1 @@
require_relative 'index'