Maybe is a dumb question but I’m starting to play with Jets. I had a little experience with rails but right know I’m studying Lambda and Serverless.
So I created a new Jets project, and I’m trying to do a simple hello world with the application Controller.
class ApplicationController < Jets::Controller::Base
def hello
puts “Hola mundo”
@Content = “Hello World”
end
end
To make it work with the Application layout, I made a hello.html.erb file in views/application
<%= @Content %>
And the routes file is:
Jets.application.routes.draw do
root "application#hello"
# The jets/public#show controller can serve static utf8 content out of the public folder.
# Note, as part of the deploy process Jets uploads files in the public folder to s3
# and serves them out of s3 directly. S3 is well suited to serve static assets.
# More info here: https://rubyonjets.com/docs/extras/assets-serving/
any "*catchall", to: "jets/public#show"
end
With Jets Server, It appears to be working OK.
I can see the Hello World using the application.html.erb layout an the content from the controller.
But when I deploy to AWS:
- In API Gateway the only generated Resources are:
/ /{catchall+} ANY
And the Invoke URL only shows:
{"message":"Missing Authentication Token"}
I could surpass this making a GET Resource in the root Resource
/
GET
/{catchall+}
ANY
But now. I Only see the index page used for the catchall.
I’m trying to understand what is the APy Gateway doing or what is wrong with my routes, but if I test the GET Resource on the web, It returns the correct body.
So, why I’m seeing different results between the Resource Test, and the jets servier (http://127.0.0.1:8888/) where I can see the hell world vs the Invoke URL?