Skip to content

Commit

Permalink
chore: updates to cors and api route
Browse files Browse the repository at this point in the history
  • Loading branch information
greeenboi committed Sep 30, 2024
1 parent 2487d28 commit ed397d4
Show file tree
Hide file tree
Showing 14 changed files with 491 additions and 26 deletions.
12 changes: 12 additions & 0 deletions .idea/material_theme_project_new.xml

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

4 changes: 4 additions & 0 deletions .idea/misc.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

247 changes: 247 additions & 0 deletions .idea/ruby-mailer.iml

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

1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
10 changes: 5 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ source "https://rubygems.org"

ruby "3.2.4"

gem 'dotenv-rails', groups: [:development, :test]
gem 'dotenv-rails'

group :development, :test do
gem 'rspec-rails'
gem 'mailjet'
end
gem 'mailjet'
# group :development, :test do
# gem 'rspec-rails'
# end

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.1.4"
Expand Down
19 changes: 0 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ GEM
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
diff-lcs (1.5.1)
dotenv (3.1.4)
dotenv-rails (3.1.4)
dotenv (= 3.1.4)
Expand Down Expand Up @@ -191,23 +190,6 @@ GEM
psych (>= 4.0.0)
reline (0.5.10)
io-console (~> 0.5)
rspec-core (3.13.1)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (7.0.1)
actionpack (>= 7.0)
activesupport (>= 7.0)
railties (>= 7.0)
rspec-core (~> 3.13)
rspec-expectations (~> 3.13)
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.1)
stringio (3.1.1)
thor (1.3.2)
timeout (0.4.1)
Expand All @@ -232,7 +214,6 @@ DEPENDENCIES
puma (>= 5.0)
rack-cors
rails (~> 7.1.4)
rspec-rails
tzinfo-data

RUBY VERSION
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/emails_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def send_email
Mailjet::Send.create(messages: [{
'From' => {
'Email' => ENV['MAILJET_DEFAULT_MAIL'],
'Name' => 'Suvan GS'
'Name' => ENV['MAILJET_DEFAULT_NAME']
},
'To' => [
{
Expand Down
1 change: 1 addition & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
config.action_mailer.delivery_method = :mailjet

config.action_mailer.perform_caching = false

Expand Down
2 changes: 1 addition & 1 deletion config/initializers/cors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins "localhost:3000"
origins "localhost:3000", "localhost:5500"

resource "*",
headers: :any,
Expand Down
Loading

0 comments on commit ed397d4

Please sign in to comment.