Skip to content

Commit fb695c1

Browse files
committed
Fixing 36
1 parent baa9287 commit fb695c1

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

rubyonrails/Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ end
4444

4545
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
4646
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
47+
48+
#Cors
49+
gem 'rack-cors', :require => 'rack/cors'

rubyonrails/Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ GEM
9595
puma (4.3.3)
9696
nio4r (~> 2.0)
9797
rack (2.2.2)
98+
rack-cors (1.1.1)
99+
rack (>= 2.0.0)
98100
rack-proxy (0.6.5)
99101
rack
100102
rack-test (1.1.0)
@@ -183,6 +185,7 @@ DEPENDENCIES
183185
listen (>= 3.0.5, < 3.2)
184186
mysql2 (>= 0.4.4)
185187
puma (~> 4.1)
188+
rack-cors
186189
rails (~> 6.0.2, >= 6.0.2.2)
187190
sass-rails (>= 6)
188191
spring

rubyonrails/config/application.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,13 @@ class Application < Rails::Application
3131

3232
# Don't generate system test files.
3333
config.generators.system_tests = nil
34+
35+
config.middleware.insert_before 0, Rack::Cors do
36+
allow do
37+
origins '*'
38+
resource '*', :headers => :any, :methods => [:get, :post, :options]
39+
end
40+
end
41+
3442
end
35-
end
43+
end

stack_box.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@ echo "######## SELECT YOUR STACK #############\n"
1111

1212
stack=()
1313

14+
PS3='Select your frontend: '
15+
16+
echo "FRONTEND OPTIONS:"
17+
18+
frontend_options=("Vue")
19+
select opt in "${frontend_options[@]}"
20+
do
21+
case $opt in
22+
"Vue")
23+
echo "You've chosen Vue"
24+
stack+=("vue")
25+
break;
26+
;;
27+
*) echo "Invalid option $REPLY";;
28+
esac
29+
done
30+
1431
PS3='Select your backend: '
1532

1633
echo "BACKEND OPTIONS:"
@@ -24,12 +41,12 @@ do
2441
stack+=("flask")
2542
break;
2643
;;
27-
"Option 2")
44+
"Rails")
2845
echo "You've chosen Rails"
2946
stack+=("rubyonrails")
3047
break;
3148
;;
32-
*) echo "invalid option $REPLY";;
49+
*) echo "Invalid option $REPLY";;
3350
esac
3451
done
3552

@@ -76,7 +93,7 @@ do
7693
"Done")
7794
break
7895
;;
79-
*) echo "invalid option $REPLY";;
96+
*) echo "Invalid option $REPLY";;
8097
esac
8198
done
8299

0 commit comments

Comments
 (0)