Skip to content

Commit

Permalink
Heroku setup (#192)
Browse files Browse the repository at this point in the history
* add procfile

* add cors

* add scss link direcotry

* change manifest

* change manifest 2

* change manifest 3

* change manifest 4

* change manifest 5

* fix rspec support
  • Loading branch information
DenisZackharov committed Feb 15, 2024
1 parent 5b8e28b commit d220342
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 7 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.16.0
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ gem "active_model_serializers"
gem "enumerize"
gem "graphql"
gem "interactor", "~> 3.0"
gem "rack-cors"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 6.1.7"
# Use postgresql as the database for Active Record
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ GEM
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.8)
rack-cors (2.0.1)
rack (>= 2.0.0)
rack-mini-profiler (2.3.4)
rack (>= 1.2.0)
rack-proxy (0.7.7)
Expand Down Expand Up @@ -385,6 +387,7 @@ DEPENDENCIES
pg (~> 1.1)
pry
puma (~> 5.0)
rack-cors
rack-mini-profiler (~> 2.0)
rails (~> 6.1.7)
rspec-rails (~> 6.0.0)
Expand Down
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: bundle exec puma -C config/puma.rb
7 changes: 6 additions & 1 deletion app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
//= link_tree ../images
//= link_directory ../stylesheets .css
//= link _variables.scss
//= link application.scss
//= link base.scss
//= link form.scss
//= link header.scss
//= link reset.scss
11 changes: 11 additions & 0 deletions config/initializers/cors.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if ENV["CORS_ORIGINS"].present?
Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins(*ENV.fetch("CORS_ORIGINS", "").split(","))

resource "*",
headers: :any,
methods: %i[get post put patch delete options head]
end
end
end
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
"version": "0.1.0",
"devDependencies": {
"webpack-dev-server": "^3"
},
"engines": {
"node": "16.16.0"
}
}
File renamed without changes.
7 changes: 1 addition & 6 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d220342

Please sign in to comment.