diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..9a79033 --- /dev/null +++ b/Gemfile @@ -0,0 +1,6 @@ +source 'https://rubygems.org' + +gem 'sinatra', '~> 3.0' +gem 'sinatra-contrib', '~> 3.0' +gem 'puma', '~> 6.3' + diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..3cbb969 --- /dev/null +++ b/Gemfile.lock @@ -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 diff --git a/LICENSE b/LICENSE index 5f662b3..a61994a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) +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: diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..396921a --- /dev/null +++ b/Rakefile @@ -0,0 +1,8 @@ +require 'bundler/setup' + +namespace :server do + task :start do + system("puma") + end +end + diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..0a74d21 --- /dev/null +++ b/config.ru @@ -0,0 +1,3 @@ +root = ::File.dirname(__FILE__) +require ::File.join( root, 'server' ) +run GameData.new diff --git a/server.rb b/server.rb new file mode 100755 index 0000000..42a02a2 --- /dev/null +++ b/server.rb @@ -0,0 +1,9 @@ +require 'sinatra/base' + +# Base app +class GameData < Sinatra::Base + enable :sessions +end + +# Load routes +require_relative 'src/routes/init' diff --git a/src/routes/index.rb b/src/routes/index.rb new file mode 100644 index 0000000..092db3c --- /dev/null +++ b/src/routes/index.rb @@ -0,0 +1,7 @@ +class GameData < Sinatra::Base + get '/' do + return 'Test.' + end + + # more routes... +end diff --git a/src/routes/init.rb b/src/routes/init.rb new file mode 100644 index 0000000..5e9ed2d --- /dev/null +++ b/src/routes/init.rb @@ -0,0 +1 @@ +require_relative 'index'